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/103179.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 16:46:15 CEST 2010
2010/8/23 Yury Selivanov <yselivanov at gmail.com>:
> 1) I propose to change 'hasattr' behaviour in Python 3, making it to swallow only AttributeError exceptions (exactly like 'getattr').  Probably, Python 3.2 release is our last chance.

I would be in support of that.

>
> 2) If you afraid that this new behaviour will break too much python 2 code converted with 2to3, we can introduce another 'hasattr' function defined in 2to3 module itself, and make it imported automatically in all files passed through 2to3 transformation pipeline.  This new function will mimic 'hasattr' behaviour from python 2 and converted code should work as expected.

But not this. Compatibility functions don't belong in 2to3.

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