Why no warnings when re-assigning builtin names?
grickert at coldstorage.com
Wed Aug 17 15:30:14 CEST 2011
> On 8/16/2011 7:29 PM, Terry Reedy wrote:
> On 8/16/2011 1:15 PM, Gerrat Rickert wrote:
> > I think that best practices would suggest that one shouldn't use
> > variable
> > names that shadow builtins (except in specific, special
> > so I don't really think this would be an annoyance at all. The
> > of
> > *unwanted* warnings they'd get would be pretty close to zero. OTOH,
> > response to a question I asked on StackOverflow, someone posted a
> > list of times where this isn't followed in the std lib, so there
> > to be a precedent for just using the builtin names for anything
> > one feels like at the time.
> If you run across that again and email me the link, I will take a look
> and see if I think the issue should be raised on pydev. Of course, some
> modules *intentionally* define an open function, intended to be
> as 'mod.open' and not as 'from mod import *; open'. Also,
> attributes can also reuse builtin names. But 'open = <True/False>'
> be bad.
> Terry Jan Reedy
See the accepted answer to this question:
More information about the Python-list