nested scopes

Robin Becker robin at jessikat.fsnet.co.uk
Fri Feb 2 19:47:55 EST 2001


In article <p6qbsskohqr.fsf at informatik.hu-berlin.de>, Martin von Loewis
<loewis at informatik.hu-berlin.de> writes
>Robin Becker <robin at jessikat.fsnet.co.uk> writes:
>
>> Is it really true that J Hylton's nested scopes will cause code like
>> 
>> def bingo():
>>   from string import *
>>   ....
>> 
>> to be declared bad? 
>
>That code has been bad for a long time. See
>
>http://www.python.org/doc/current/ref/import.html
>
>which says
>
># The from form with "*" may only occur in a module scope.
>
>It is only now that this restriction is enforced by CPython; again,
>the code was incorrect for a long time (see
>
>http://www.python.org/doc/1.4/ref/ref6.html#REF17806
>
>to get my point; it was also in the 1.1 version of the language
>reference).
>
>Regards,
>Martin
imho it's the restriction which is bad. It's just a bunch of imports and
assignments.
-- 
Robin Becker



More information about the Python-list mailing list