On Tue, Jun 10, 2003, Guido van Rossum wrote: > > But I'm not at all happy with the proposed deprecation of > > raise Class > and > raise Class, arguments > > in favor of > > raise Class() > and > raise Class(arguments) > > I don't see how this change is necessary in order to get any of the > other benefits. Yeah. I've been thinking a bit, and while the proposed change makes some sense for the case where you're passing an argument to an exception, it makes this look uglier: class Found(Exception): pass try: for record in records: for field in record.fields: if data in field.data: raise Found() except Found: # handle success else: # handle failure I find that extra set of parentheses unnecessary and ugly. It implies a callable where it's not really being used that way, particularly in the asymmetry between the ``raise`` and the ``except``. If this change goes through, I might start doing class Found(Exception): pass Found = Found() -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to do, you'd better not start writing it." --Dijkstra
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