re: Good and Bad Practices of Coding in Python VIEW POST

FULL DISCUSSION
 

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.

 

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.

code of conduct - report abuse