Update the PEP to reflect that Exact and Inexact were dropped shortly after Pycon.
This commit is contained in:
parent
2840a2d09b
commit
922cb7554a
25
pep-3141.txt
25
pep-3141.txt
|
@ -16,10 +16,8 @@ Abstract
|
|||
This proposal defines a hierarchy of Abstract Base Classes (ABCs) (PEP
|
||||
3119) to represent number-like classes. It proposes a hierarchy of
|
||||
``Number :> Complex :> Real :> Rational :> Integral`` where ``A :> B``
|
||||
means "A is a supertype of B", and a pair of ``Exact``/``Inexact``
|
||||
classes to capture the difference between ``floats`` and
|
||||
``ints``. These types are significantly inspired by Scheme's numeric
|
||||
tower [#schemetower]_.
|
||||
means "A is a supertype of B". The hierarchy is inspired by Scheme's
|
||||
numeric tower [#schemetower]_.
|
||||
|
||||
Rationale
|
||||
=========
|
||||
|
@ -394,25 +392,6 @@ And finally integers::
|
|||
return 1
|
||||
|
||||
|
||||
Exact vs. Inexact Classes
|
||||
-------------------------
|
||||
|
||||
Floating point values may not exactly obey several of the properties
|
||||
you would expect. For example, it is possible for ``(X + -X) + 3 ==
|
||||
3``, but ``X + (-X + 3) == 0``. On the range of values that most
|
||||
functions deal with this isn't a problem, but it is something to be
|
||||
aware of.
|
||||
|
||||
Therefore, we define ``Exact`` and ``Inexact`` ABCs to mark whether
|
||||
types have this problem. Every instance of ``Integral`` and
|
||||
``Rational`` should be Exact, but ``Reals`` and ``Complexes`` may or
|
||||
may not be. (Do we really only need one of these, and the other is
|
||||
defined as ``not`` the first?) ::
|
||||
|
||||
class Exact(Number): pass
|
||||
class Inexact(Number): pass
|
||||
|
||||
|
||||
Changes to operations and __magic__ methods
|
||||
-------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue