A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2008-October/083214.html below:

[Python-Dev] Proper initialization of structs

[Python-Dev] Proper initialization of structs [Python-Dev] Proper initialization of structsAlexandre Vassalotti alexandre at peadrop.com
Fri Oct 31 00:51:47 CET 2008
On Thu, Oct 30, 2008 at 6:36 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Alexandre Vassalotti wrote:
>> And that is exactly the reason why, the _pickle module doesn't use
>> __new__ for initialization.  Doing any kind of argument parsing in
>> __new__ prevents subclasses from customizing the arguments for their
>> __init__.
>
> No it doesn't - it just means the subclasses have to override __new__ as
> well and then give the parent class the arguments it needs.
>

Right, and that's what subclasses of built-in types need to do.
However for _pickle, I wanted to reduce interface differences between
the Python implementation. Perhaps, in that case, moving the content
of __init__ methods in both implementations would have been a better
choice. That would certainly make it easier to expose internal methods
easier to fix issue3385. Is it too late to change?

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