Apr-20-2017, 09:58 PM
(Apr-20-2017, 08:56 PM)smbx33 Wrote:..... for copy in range(copies): ......
Since there's a standard module named
copy
, the variable with the same name may overshadow it(slim chance, but still). Names that may overshadow standard functions and modules are not recommended. How would you know which are? Single word that may sound like a standard function, e,g,
map
, filter
, string
. Rule of the thumb - when in doubt, add underscore at the end. Or use the beloved Pythonic snake style
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.