[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.108,1.109

Finn Bock bckfnn@worldonline.dk
2001年1月31日 12:49:22 GMT


>> > Note that Jeremy is only raising errors for "from M import *".
>>>> No, he says he's also raising errors for 'import spam' if 'spam' is declared
>> global, like so:
>>>> def viking():
>> global spam
>> import spam
>>Yeah, this was just brought to my attention at our group meeting
>today. I'm with you on this one -- there really isn't a good reason
>why this shouldn't work. (I wonder why that constraint was ever added
>to the reference manual; maybe I was just upset that someone would
>*do* something as ugly as that, or maybe there was a J[P]ython
>reason???.)

Previously Jython have had problems with "from .. import *" in function
scope, and still have problems when used with the python -> java
compiler:
http://sourceforge.net/bugs/?func=detailbug&bug_id=122834&group_id=12867
Using global on an import name is currently ignored by Jython because
the name assignment is done by the runtime, not the compiler.
regards,
finn

AltStyle によって変換されたページ (->オリジナル) /