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/2005-January/050692.html below:

[Python-Dev] Let's get rid of unbound methods

[Python-Dev] Let's get rid of unbound methods [Python-Dev] Let's get rid of unbound methodsBarry Warsaw barry at python.org
Wed Jan 5 18:26:38 CET 2005
On Wed, 2005-01-05 at 10:37, Glyph Lefkowitz wrote:

> One approach I have taken in order to avoid copiously over-documenting
> every super() using class is to decouple different phases of
> initialization by making __init__ as simple as possible (setting a few
> attributes, resisting the temptation to calculate things), and then
> providing class methods like '.fromString' or '.forUnserialize' that
> create instances that have been completely constructed for a particular
> purpose.  That way the signatures are much more likely to line up across
> inheritance hierarchies.  Perhaps this should be a suggested "best
> practice" when using super() as well?

Yep, I've done the same thing.  It's definitely a good practice.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20050105/f78f1142/attachment.pgp
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