A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-August/103194.html below:

[Python-Dev] 'hasattr' is broken by design

[Python-Dev] 'hasattr' is broken by design [Python-Dev] 'hasattr' is broken by designBenjamin Peterson benjamin at python.org
Mon Aug 23 22:17:46 CEST 2010
2010/8/23 Guido van Rossum <guido at python.org>:
> The main problem I can see with letting exceptions other than
> AttributeError bubble through (besides perverted dependencies on the
> current semantics) is that there are some situations where it is
> pretty arbitrary whether TypeError or AttributeError is raised. I
> can't recall the details, and possibly this was more of a problem with
> classic classes, but I do think it warrants some research.

I believe this was with regards to actual operations, though, not
fetching the attribute. For example, float(a) would raise an
AttributeError for a classic instance and a TypeError for a new-style
instance. However both would raise AttributeError on a.__float__.



-- 
Regards,
Benjamin
More information about the Python-Dev mailing list

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