DEV Community

Discussion on: Good and Bad Practices of Coding in Python

Collapse
 
idanarye profile image
Idan Arye

Please don't treat numbers as booleans. It makes sense when you are checking for None or for emptiness, but in case of numbers it's just confusing. That's an artifact of the C heritage all languages and programmers have nowadays, but that doesn't mean we should be using it.

Collapse
 
arnauddupuis profile image
Arnaud Dupuis

Agreed!

Collapse
 
tariqabughofa profile image
Tariq Abughofa

I totally agree but the sad thing is that many of these practices are considered "pythonic".