Quoth Aahz: [...] > raise Found() > except Found: [...] > I find that extra set of parentheses unnecessary and ugly. It implies a > callable where it's not really being used that way, [...] In raise Found Found *is* being used as a callable under the hood; an instance of Found is created implicitly. You just happen not to care about that instance. > [...] particularly in the > asymmetry between the ``raise`` and the ``except``. [...] 'raise' and 'except' *are* asymmetrical; instances are raised, but they are caught by class. As the PEP says, the current syntactic symmetry is misleading in general (though, I admit, not especially so in your code sample). > [...] If this change goes > through, I might start doing > > class Found(Exception): > pass > Found = Found() That you think this would work supports my claim that the present syntax is misleading. <wink> -- Steven Taschuk staschuk@telusplanet.net Every public frenzy produces legislation purporting to address it. (Kinsley's Law)
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