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.
Most of my projects are on Bitbucket at the moment but will be moved to GitHub soon due to the shutdown of mercurial support.
See: https://bitbucket.org/labscript_suite/
Location
Australia
Education
PhD (Physics), BSc Advanced with honours (first class honours in Physics, majors: physics, maths)
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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.