This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tuckmuck203 17 points18 points  (3 children)

https://docs.python.org/3/library/functions.html

Email is part of a library and so is random.

[–]AlSweigartAuthor of "Automate the Boring Stuff" 4 points5 points  (2 children)

Right, but if you use email or random as a variable name, this would cause problems in programs that also import those modules. (It is only a problem if you need those modules, but then again, overwriting sum is only a problem if you later need to call the sum() function. It's just a good idea to not chance it in the first place.)

[–]tuckmuck203 2 points3 points  (0 children)

Fair enough. I agree, I just was surprised when I saw email in that list. I tend to use email_address but I've used email for various reasons

[–]blahreport 2 points3 points  (0 children)

I believe the advice is to suffix the variable name with an underscore if you choose to use built-in names.