[Python-3000] PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

Jim Jewett jimjjewett at gmail.com
Thu Apr 26 00:48:13 CEST 2007


On 4/25/07, Guido van Rossum <guido at python.org> wrote:

> ... If we insist that built-in types are immutable ... They
> could write things like

> class MyFloat(float, DivisionRing): pass

> but this would be fairly painful.

Worse than that once you get 3rd parties involved.

try:
   from gmpy import mpf
except ImportError:
   class mpf(object): pass

class MyFloat(float, DivisionRing, gmpy): pass
    # err ... will this even work at all, with two concrete types?

> On 4/25/07, Jeffrey Yasskin <jyasskin at gmail.com> wrote:
> > will seeing "Ring"
> > in a list of superclasses be enough to confuse people?

Yes.  That is part of the problem with twisted -- there are so many
layers of abstraction that it takes a while to find something.  If
users ever see "Ring" outside of a footnote or the advanced math
section, then something went wrong.

-jJ


More information about the Python-3000 mailing list