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/2008-October/083206.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
Thu Oct 30 23:23:09 CET 2008
On Thu, Oct 30, 2008 at 1:00 PM, Fred Drake <fdrake at acm.org> wrote:
> It's good to move work into __init__ where reasonable, so that it can be
> avoided if a subclass wants it done in a completely different way, but new
> can't work that way.
>

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

Although, I agree that __new__ should be used, whenever it is
possible, to initialize struct members.

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