DEV Community

Discussion on: Good and Bad Practices of Coding in Python

Collapse
 
herobank110 profile image
David Kanekanian

Checking an optional argument evaluates to True will not do the same as explicitly checking it is not None. If an empty list was passed as an argument it would still evaluate to False and a new list would be made.

Collapse
 
philipstarkey profile image
Phil Starkey

Was going to say the same thing! That part of the article is definitely poor advice, especially for newcomers who are likely not already be confused by the behaviour.