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/2006-July/067501.html below:

[Python-Dev] User's complaints

[Python-Dev] User's complaints [Python-Dev] User's complaintsArmin Rigo arigo at tunes.org
Mon Jul 17 20:22:35 CEST 2006
Hi Jeroen,

On Thu, Jul 13, 2006 at 02:02:22PM +0200, Jeroen Ruigrok van der Werven wrote:
> He doesn't specifically need the builtin types to be extendable. It's
> just nice to be able to define a single class in multiple modules.

There are various simple ways to do this; the one I'm using from time to
time is the "extendabletype" metaclass from:

   http://codespeak.net/svn/pypy/dist/pypy/annotation/pairtype.py

Example:

   class A:
       __metaclass__ = extendabletype
       def f(...): ...

Somewhere else:

   class __extend__(A):
       def g(...): ...

FWIW the above 30-lines file also contains a fast double-dispatch
multimethod implementation :-)


A bientot,

Armin
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