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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4