Bugs item #1155938, was opened at 2005-03-03 10:42
Message generated for change (Settings changed) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1155938&group_id=5470

Category: Type/class unification
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Steve Alexander (stevea_zope)
>Assigned to: Raymond Hettinger (rhettinger)
Summary: yield in __init__ causes broken new-style class

Initial Comment:

 class Foo(object):
 
     def __init__(self):
         print "foo"
         raise RuntimeError
         yield 23

 Foo()

With a classic class, this correctly fails saying
"__init__ must return None".  With a new-style class,
the class suite works, and Foo() is called without
reporting an error, but also without printing "foo".


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

Comment By: Michael Hudson (mwh)
Date: 2005-03-03 11:02

Message:
Logged In: YES 
user_id=6656

You don't have to be that cute:

>>> class Foo(object):
...  def __init__(self):
...   return "foo"
... 

where did that check go?

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1155938&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