[Excluding any test code that just mocks a builtin]
Given that many builtins have been added over time, if there are multiple occurrences, I’d accept an answer showing a module or some code that was created after that builtin existed.
My rationale for asking is that after posting a question on the python mailing list, some of the responses indicated that there are members of the Python community that think its
perfectly reasonable to use variable names that shadow builtins when any other name would work just as well.
I’d like to use the standard library as a gauge to how common this practice is among the various Python developers.
The builtin I most often shadow is
id, both because it’s so useful as a variable name, and the builtin is so rarely called anyway. A quick look in the 2.7 standard library turned up a number of uses:There are plenty of uses of
str,list, andintalso:and there are too many
fileanddiruses to post…