[IPython-dev] Bug in revision 1029+

Fernando Perez Fernando.Perez at colorado.edu
Wed Jan 18 16:38:23 EST 2006


Ville Vainio wrote:
> On 1/18/06, Jörgen Stenarson <jorgen.stenarson at bostream.nu> wrote:
> 
> 
>>Hi
>>
>>%run seems to have changed how it handles stack frames from revision
>>1029. The attached python file a.py and b.py works when executed from
> 
> 
> http://projects.scipy.org/ipython/ipython/changeset/1029
> 
> Apparently assigning the __file__ variable screws up "inspect" operations.
> 
> It all seems rather magical, perhaps there are also other evil side
> effects on assigning __file__? I'm thinking that perhaps we should
> leave __file__ unassigned after all.

Shoot.  I added __file__ to try and match the behavior of the standard 
interpreter, which DOES define such names in the script's namespace.  This was 
reported as a bug by Vivian a few days ago.  I'll try to look into Jorgen's 
report in more detail tonight, and at least find what the proper solution is.

I do think that, since Python determines that __file__ IS always defined in 
the execution namespace of a script, we should certainly declare it.

Cheers,

f




More information about the IPython-dev mailing list