It's better not to use reserved words when declaring variables, such as
Such usage can lead to confusion if you've used the likes of
for str in data:
, because if you need to use the str()
function in that loop, you won't be able to.Such usage can lead to confusion if you've used the likes of
str = "Whatever"
at some point and need the function further down; an error such as [builtins.TypeError: 'str' object is not callable]
could very well throw you for a while, until you figure out what you've done: code blindness sets in, along with some frustration, if you fail to spot the mistake right away -- prevention is better than a cure.
Sig:
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein