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/2009-July/090633.html below:

[Python-Dev] 2.6 object.__init__ & deling __new__

[Python-Dev] 2.6 object.__init__ & deling __new__ [Python-Dev] 2.6 object.__init__ & deling __new__P.J. Eby pje at telecommunity.com
Wed Jul 15 06:25:02 CEST 2009
At 04:11 PM 7/14/2009 -0500, Benjamin Peterson wrote:
>4. When __init__() is overridden, and the subclass __init__() 
>calls       object.__init__(), the latter should complain about 
>excess       arguments; ditto for __new__().

Actually, this rule is a PITA, because there's no good way to get rid 
of the warnings when you're trying to write MRO-agnostic mixins.

In other words, it negates many of the gains that were obtained by 
having new-style MROs, since you can no-longer write pass-through 
constructors that leave their arguments untouched.  Instead, every 
class must know ahead of time whether it will be the "last" class 
before 'object' -- thereby making it impossible to slip other mixins 
into the chain below them.

In effect, 2.6 forces you to have a common known base class *other* 
than 'object' in order to write co-operative classes.  :-(


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