[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-idle-dev
Subject:    [Idle-dev] Use of __future__ features in IDLE
From:       mats () laplaza ! org (Mats Wichmann)
Date:       2002-01-19 14:10:56
Message-ID: 5.1.0.14.1.20020119210445.00ae18a0 () 204 ! 151 ! 72 ! 2
[Download RAW message or body]

I just had occasion to try out an interactive example
that's intended to demonstrate the difference in
Python 2.1 (still the subject of my training curriculum
for a while) of:

from __future__ import nested_scopes

... and was somewhat surprised to find out that in
the IDLE distributed with Python 2.1.1 at least, it
seems to have no effect, throwing an exception as
if the nested_scopes were not enabled:

   SyntaxError: local name 'b' in 'testfun' shadows use of 'b'
   as global in nested scope 'inner_test' (<pyshell#26>, line 1)

I'm being a little lazy here, for several days I don't
have access to any of my normal stuff, only email, so I
can't see what happens with idlefork, the idle in 2.2,
or so on (of course, in 2.2, I'd have to find a different
future feature to try).  The same bit of test code has no
problems demonstrating the behavior (i.e. showing the
difference between the import and omitting it) through the
regular Python 2.1 interpreter, or Jython 2.1 for that
matter.

Just curious what's going on here and if there's a way
to address it? 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic