DEV Community

Discussion on: Good and Bad Practices of Coding in Python

Collapse
 
schneebuzz profile image
schneebuzz • Edited

Nice writing.

For the optional argument check it's also possible to do

seq = seq or []

so if it's None it will assign an empty list or use seq otherwise.
Or are there any downsides with this approach?
E: Ok in case seq is already an empty list it will be reassigned anyway.