Subclasses of this type describe complex numbers and include the operations
that work on the built-in :class:`complex` type. These are: conversions to
:class:`complex` and :class:`bool`, :attr:`.real`, :attr:`.imag`, ``+``,
- ``-``, ``*``, ``/``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!=``. All
- except ``-`` and ``!=`` are abstract.
+ ``-``, ``*``, ``/``, ``**``, :func:`abs`, :meth:`conjugate`, ``==``, and
+ ``!=``. All except ``-`` and ``!=`` are abstract.
.. attribute:: real
Subtypes :class:`Rational` and adds a conversion to :class:`int`. Provides
defaults for :func:`float`, :attr:`~Rational.numerator`, and
- :attr:`~Rational.denominator`. Adds abstract methods for ``**`` and
- bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``.
+ :attr:`~Rational.denominator`. Adds abstract methods for :func:`pow` with
+ modulus and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``,
+ ``~``.
Notes for type implementors
"""Complex defines the operations that work on the builtin complex type.
In short, those are: a conversion to complex, .real, .imag, +, -,
- *, /, abs(), .conjugate, ==, and !=.
+ *, /, **, abs(), .conjugate, ==, and !=.
If it is given heterogeneous arguments, and doesn't have special
knowledge about them, it should fall back to the builtin complex
class Integral(Rational):
- """Integral adds a conversion to int and the bit-string operations."""
+ """Integral adds methods that work on integral numbers.
+
+ In short, these are conversion to int, pow with modulus, and the
+ bit-string operations.
+ """
__slots__ = ()