Tal Einat <talei...@users.sourceforge.net> added the comment:

I believe IDLE runs modules via execfile(), so I would expect the behavior to 
be similar, and execfile() does not set __file__. Doing "Run Module" is also 
IMO equivalent to doing execfile(), so this behavior retains consistency.

However, I would expect __file__ to be set when running IDLE -r <script>, but I 
get "name '__file__' is not defined" (with Python 2.6.2). This is inconsistent 
and should be fixed.

nosy: +taleinat

Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list

Reply via email to