ugly python namespace bug

Rob Hodges s323140 at student.uq.edu.au
Tue Dec 21 12:30:51 EST 1999


Jeff <jam at quark.emich.edu> writes:

> On Wed, Dec 22, 1999 at 02:22:24AM +1000, Rob Hodges wrote:
> [..snipped...]
> > I think it would be more appropriate if you could, in each file,
> > optionally place a statement that tells the interpreter to treat
> > built-ins as keywords. 

> personally, instead of adding a directive like this, what about a command
> line option to the interpreter that will check for usage like that? it would
> have to tie into the syntax of the language, but it would spit out a warning
> if it detected a script using a keyword as a variable (like 'dir' or
> 'type'), and then the programmer has the option to either leave it like that
> or fix it. this seems a heck of a lot simpler. thoughts?

I thought about this but decided I wouldn't want to see warnings for
anybody else's modules I imported.  But if it only warned when
byte-compiling, that wouldn't be a problem.  So provided that were the
case, I agree this would be a better approach.

-Rob




More information about the Python-list mailing list