> From: Guido van Rossum [mailto:guido@python.org] >=20 > OTOH there's something to say for fewer errors, not more; > e.g. sometimes I wish AttributeError and TypeError were unified, > because AttributeError usually means that an object isn't of the > expected type. Hmm ... I was going to ask if there was any reason not to make = AttributeError a subclass of TypeError, but that would mean that code = like: try: ... except TypeError: ... would also catch all AttributeErrors. Maybe we should have a __future__ directive and phase it in starting in = 2.4? I wouldn't suggest making AttributeError and TypeError be synonyms = though ... I think it is useful to distinguish the situations. I can't think of any case in *my* code where I would want to distinguish = between a TypeError and an AttributeError - usually I end up having: try: ... except (TypeError, AttributeError): ... Tim Delaney
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