Index: peps/pep-3141.txt =================================================================== --- peps/pep-3141.txt (revision 63964) +++ peps/pep-3141.txt (working copy) @@ -132,15 +132,6 @@ raise NotImplementedError @abstractmethod - def __pow__(self, exponent): - """a**b; should promote to float or complex when necessary.""" - raise NotImplementedError - - @abstractmethod - def __rpow__(self, base): - raise NotImplementedError - - @abstractmethod def __abs__(self): """Returns the Real distance from 0.""" raise NotImplementedError @@ -321,65 +312,6 @@ """__index__() exists because float has __int__().""" return int(self) - @abstractmethod - def __pow__(self, exponent, modulus=None): - """self ** exponent % modulus, but maybe faster. - - Implement this if you want to support the 3-argument - version of pow(). Otherwise, just implement the 2-argument - version described in Complex. If modulus is None, this - should behave as the 2-argument version; otherwise, raise - a TypeError if exponent < 0 or any argument isn't - Integral. - """ - raise NotImplementedError - - @abstractmethod - def __lshift__(self, other): - """i<>j returns i // 2**j.""" - raise NotImplementedError - - @abstractmethod - def __rrshift__(self, other): - raise NotImplementedError - - @abstractmethod - def __and__(self, other): - raise NotImplementedError - - @abstractmethod - def __rand__(self, other): - raise NotImplementedError - - @abstractmethod - def __xor__(self, other): - raise NotImplementedError - - @abstractmethod - def __rxor__(self, other): - raise NotImplementedError - - @abstractmethod - def __or__(self, other): - raise NotImplementedError - - @abstractmethod - def __ror__(self, other): - raise NotImplementedError - - @abstractmethod - def __invert__(self): - raise NotImplementedError - # Concrete implementations of Rational and Real abstract methods. def __float__(self): @@ -394,25 +326,7 @@ 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 -------------------------------------------