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/103241.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
Tue Aug 24 14:31:18 CEST 2010
2010/8/24 Hrvoje Niksic <hrvoje.niksic at avl.com>:
> The __length_hint__ lookup expects either no exception or AttributeError,
> and will propagate others.  I'm not sure if this is a bug.  On the one hand,
> throwing anything except AttributeError from __getattr__ is bad style (which
> is why we fixed the bug by deriving our business exception from
> AttributeError), but the __length_hint__ check is supposed to be an internal
> optimization completely invisible to the caller of list().

__length_hint__ is internal and undocumented, so it can do whatever it wants.



-- 
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