Oleg Broytmann <phd <at> phd.pp.ru> writes:

> 
> On Mon, Mar 17, 2008 at 06:35:46PM -0400, Alexander Belopolsky wrote:
> > class x:
> >  pass
> > class y(x):
> >  pass
> > try:
> >  raise y
> > except y:
> >  print "a"
> > except:
> >  print "b"
> > 
> > It prints 'b'.
> 
>    Python 2.2, 2.3, 2.4 and 2.5 on Linux: prints 'a'.
> 

Sorry, my fault.  It prints 'a' without __metaclass__ = type,
but prints 'b' with the metaclass.  The output should be the
same in both cases.

The problematic case is:


__metaclass__ = type 
class x: 
    pass 
class y(x): 
    pass 
try: 
    raise y 
except y: 
    print "a" 
except: 
    print "b" 


the above code prints 'b' in 2.x


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to