Bugs item #1327110, was opened at 2005-10-14 16:25
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1327110&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.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Yusuke Shinyama (euske)
Assigned to: Nobody/Anonymous (nobody)
Summary: wrong TypeError traceback in generator expressions

Initial Comment:
In the following session, the TypeError traceback of '
'.join( foo(i) for i in range(10) ) is wrong. The cause
is not because of being a generator, but of its
manually created exception.
--------------------------
Python 2.4.2 (#1, Oct 14 2005, 16:08:57)
[GCC 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on
linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> def foo(x): raise TypeError('foo!')
...
>>> def bar(x): raise ValueError('bar!')
...
>>> ' '.join( foo(i) for i in range(10) )
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: sequence expected, generator found
>>> ' '.join( bar(i) for i in range(10) )
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "<stdin>", line 1, in <generator expression>
  File "<stdin>", line 1, in bar
ValueError: bar!


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1327110&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to