[Python-Dev] 'shadowing' builtins

Thomas Wouters thomas@xs4all.net
Mon, 17 Jul 2000 20:01:16 +0200


This is probably the wrong time, given that most of y'all are likely on
their way to OSCON ;) But the perl-hugging hippy colleague of mine that is
currently at OSCON gave (as in 'handed') me this idea on shadowing builtins.

He decided to go to David Beazly's python introduction, and he was suprised
at how you can do 'None = 4'. And when I explained it's harmless (because
it's local, not global) he was suprised it didn't generate a warning. And,
well, why doesn't it generate a warning ? Only with an, uhm, '-w' option or
so, of course, or perhaps add it to the '-t' option. It would be also a
compile-time-check. It might require a seperate lookup table (haven't looked
at it at all, yet) that duplicates the 'builtin' namespace, but I'd think
it's worth it.

Or is this an old and already-shot-down idea ? :)

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!