summaryrefslogtreecommitdiffstats
path: root/Lib/numbers.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-01-20 20:34:19 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-01-20 20:34:19 (GMT)
commit933d3a7a5474d135e451980a42171a690bd2bd2d (patch)
tree4e3e017c160d3654c8b85ba656f92580f5b7107d /Lib/numbers.py
parente548d2487d972288b60d45c25b2820b8cb2b65b6 (diff)
downloadcpython-933d3a7a5474d135e451980a42171a690bd2bd2d.zip
cpython-933d3a7a5474d135e451980a42171a690bd2bd2d.tar.gz
cpython-933d3a7a5474d135e451980a42171a690bd2bd2d.tar.bz2
Issue 4998: __slots__ on Fractions was useless.
Diffstat (limited to 'Lib/numbers.py')
-rw-r--r--Lib/numbers.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/numbers.py b/Lib/numbers.py
index fa59fd8..540e7d5 100644
--- a/Lib/numbers.py
+++ b/Lib/numbers.py
@@ -17,6 +17,7 @@ class Number(object):
caring what kind, use isinstance(x, Number).
"""
__metaclass__ = ABCMeta
+ __slots__ = ()
# Concrete numeric types must provide their own hash implementation
__hash__ = None
@@ -41,6 +42,8 @@ class Complex(Number):
type as described below.
"""
+ __slots__ = ()
+
@abstractmethod
def __complex__(self):
"""Return a builtin complex instance. Called for complex(self)."""
@@ -172,6 +175,8 @@ class Real(Complex):
Real also provides defaults for the derived operations.
"""
+ __slots__ = ()
+
@abstractmethod
def __float__(self):
"""Any Real can be converted to a native float object.
@@ -265,6 +270,8 @@ Real.register(float)
class Rational(Real):
""".numerator and .denominator should be in lowest terms."""
+ __slots__ = ()
+
@abstractproperty
def numerator(self):
raise NotImplementedError
@@ -288,6 +295,8 @@ class Rational(Real):
class Integral(Rational):
"""Integral adds a conversion to long and the bit-string operations."""
+ __slots__ = ()
+
@abstractmethod
def __long__(self):
"""long(self)"""