[Python-Dev] DeprecationWarning: assignment shadows builtin
Samuele Pedroni
pedronis@bluewin.ch
Wed, 16 Jul 2003 22:30:35 +0200
At 12:52 16.07.2003 -0700, Neil Schemenauer wrote:
> > Does the DeprecationWarning mean that I cannot provide this intuitive
> > interface anymore?
>
>That was not the intention. Having module globals that shadow builtins
>is okay. The warning is supposed to be triggered if the scope of a name
>is changed from builtin to global at runtime. Eg:
>
> import string
> string.str = 'ha ha'
>
>That's a strange thing to do and I suspect there is little code out
>there that does it. Unfortunately the code that tries to detect it is
>imperfect.
I seriously think that the code triggering the warning should be backed off,
I discussed about the warning/global speedup issue with Guido at
Europython, I didn't propose there to back it off, and we didn't finish,
still it was more or less clear that there is no strong case at the moment
for the warning, because it is unclear whether is the right kind of flavor
of limitation in terms of having a simple explanation for it, the issue
with __init__ modules is still unclear etc...
regards.