[ python-Bugs-1514617 ] evaluated code filename changed to <module> instead of ?

SourceForge.net noreply at sourceforge.net
Sun Jul 2 22:18:00 CEST 2006


Bugs item #1514617, was opened at 2006-06-29 16:07
Message generated for change (Comment added) made by kuran
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1514617&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: James Y Knight (foom)
Assigned to: Nobody/Anonymous (nobody)
Summary: evaluated code filename changed to <module> instead of ?

Initial Comment:
It seems as though the default filename for evaluated changed from "?" to 
"<module>". Was this intentional? (it's causing some test failures for me. 
The tests are correctable of course, but it doesn't seem to be an obvious 
improvement in behavior, so if it wasn't intentional, perhaps it should be 
changed back.)

Python 2.3.5 (#1, Mar 20 2005, 20:38:20) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin

>>> eval("0/0")    
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "<string>", line 0, in ?


Python 2.5b1 (trunk:47096, Jun 25 2006, 23:18:21) 
[GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin

>>> eval("0/0")    
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero


----------------------------------------------------------------------

Comment By: Jp Calderone (kuran)
Date: 2006-07-02 16:18

Message:
Logged In: YES 
user_id=366566

Note that in the example James included, the code is /not/
in a module.

A clear improvement to me would be to say something like
<repl> or <interactive prompt> in the case James pasted and
<the name of a module> for the case of top-level code.

"<module>" is about as information-free as "?".


----------------------------------------------------------------------

Comment By: Collin Winter (collinwinter)
Date: 2006-07-01 14:26

Message:
Logged In: YES 
user_id=1344176

For me, this is indeed an obvious improvement in behaviour.
"<module>" is a much clearer indicator of where the code in
question is located; using "?" could mean that it's anywhere.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1514617&group_id=5470


More information about the Python-bugs-list mailing list