Abstract base classes for rings - General Rings, Ideals, and Morphisms

Skip to content
Back to top
View this page
Edit this page

# Abstract base classes for rings

class sage.rings.abc.AlgebraicField

  Bases: `AlgebraicField_common`

  Abstract base class for `AlgebraicField`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(QQbar, sage.rings.abc.AlgebraicField)                          # needs sage.rings.number_field
      True
      sage: isinstance(AA, sage.rings.abc.AlgebraicField)                             # needs sage.rings.number_field
      False

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(QQbar, sage.rings.abc.AlgebraicField)                          # needs sage.rings.number_field
      True
      >>> isinstance(AA, sage.rings.abc.AlgebraicField)                             # needs sage.rings.number_field
      False

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.AlgebraicField.__subclasses__()                            # needs sage.rings.number_field
      [<class 'sage.rings.qqbar.AlgebraicField'>]

      sage: len(sage.rings.abc.AlgebraicField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.AlgebraicField.__subclasses__()                            # needs sage.rings.number_field
      [<class 'sage.rings.qqbar.AlgebraicField'>]

      >>> len(sage.rings.abc.AlgebraicField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.AlgebraicField_common

  Bases: `Field`

  Abstract base class for `AlgebraicField_common`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(QQbar, sage.rings.abc.AlgebraicField_common)                   # needs sage.rings.number_field
      True
      sage: isinstance(AA, sage.rings.abc.AlgebraicField_common)                      # needs sage.rings.number_field
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(QQbar, sage.rings.abc.AlgebraicField_common)                   # needs sage.rings.number_field
      True
      >>> isinstance(AA, sage.rings.abc.AlgebraicField_common)                      # needs sage.rings.number_field
      True

  By design, other than the abstract subclasses `AlgebraicField` and `AlgebraicRealField`, there is only one direct implementation subclass:

  Sage

      sage: sage.rings.abc.AlgebraicField_common.__subclasses__()                     # needs sage.rings.number_field
      [<class 'sage.rings.abc.AlgebraicField'>,
       <class 'sage.rings.abc.AlgebraicRealField'>,
       <class 'sage.rings.qqbar.AlgebraicField_common'>]

      sage: len(sage.rings.abc.AlgebraicField_common.__subclasses__()) <= 3
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.AlgebraicField_common.__subclasses__()                     # needs sage.rings.number_field
      [<class 'sage.rings.abc.AlgebraicField'>,
       <class 'sage.rings.abc.AlgebraicRealField'>,
       <class 'sage.rings.qqbar.AlgebraicField_common'>]

      >>> len(sage.rings.abc.AlgebraicField_common.__subclasses__()) <= Integer(3)
      True

class sage.rings.abc.AlgebraicRealField

  Bases: `AlgebraicField_common`

  Abstract base class for `AlgebraicRealField`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(QQbar, sage.rings.abc.AlgebraicRealField)                      # needs sage.rings.number_field
      False
      sage: isinstance(AA, sage.rings.abc.AlgebraicRealField)                         # needs sage.rings.number_field
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(QQbar, sage.rings.abc.AlgebraicRealField)                      # needs sage.rings.number_field
      False
      >>> isinstance(AA, sage.rings.abc.AlgebraicRealField)                         # needs sage.rings.number_field
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.AlgebraicRealField.__subclasses__()                        # needs sage.rings.number_field
      [<class 'sage.rings.qqbar.AlgebraicRealField'>]

      sage: len(sage.rings.abc.AlgebraicRealField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.AlgebraicRealField.__subclasses__()                        # needs sage.rings.number_field
      [<class 'sage.rings.qqbar.AlgebraicRealField'>]

      >>> len(sage.rings.abc.AlgebraicRealField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.CallableSymbolicExpressionRing

  Bases: `SymbolicRing`

  Abstract base class for `CallableSymbolicExpressionRing_class`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: f = x.function(x).parent()                                                # needs sage.symbolic
      sage: isinstance(f, sage.rings.abc.CallableSymbolicExpressionRing)              # needs sage.symbolic
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> f = x.function(x).parent()                                                # needs sage.symbolic
      >>> isinstance(f, sage.rings.abc.CallableSymbolicExpressionRing)              # needs sage.symbolic
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.CallableSymbolicExpressionRing.__subclasses__()            # needs sage.symbolic
      [<class 'sage.symbolic.callable.CallableSymbolicExpressionRing_class'>]

      sage: len(sage.rings.abc.CallableSymbolicExpressionRing.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.CallableSymbolicExpressionRing.__subclasses__()            # needs sage.symbolic
      [<class 'sage.symbolic.callable.CallableSymbolicExpressionRing_class'>]

      >>> len(sage.rings.abc.CallableSymbolicExpressionRing.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.ComplexBallField

  Bases: `Field`

  Abstract base class for `ComplexBallField`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(CBF, sage.rings.abc.ComplexBallField)                          # needs sage.libs.flint
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(CBF, sage.rings.abc.ComplexBallField)                          # needs sage.libs.flint
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.ComplexBallField.__subclasses__()                          # needs sage.libs.flint
      [<class 'sage.rings.complex_arb.ComplexBallField'>]

      sage: len(sage.rings.abc.ComplexBallField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.ComplexBallField.__subclasses__()                          # needs sage.libs.flint
      [<class 'sage.rings.complex_arb.ComplexBallField'>]

      >>> len(sage.rings.abc.ComplexBallField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.ComplexDoubleField

  Bases: `Field`

  Abstract base class for `ComplexDoubleField_class`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(CDF, sage.rings.abc.ComplexDoubleField)                        # needs sage.rings.complex_double
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(CDF, sage.rings.abc.ComplexDoubleField)                        # needs sage.rings.complex_double
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.ComplexDoubleField.__subclasses__()                        # needs sage.rings.complex_double
      [<class 'sage.rings.complex_double.ComplexDoubleField_class'>]

      sage: len(sage.rings.abc.ComplexDoubleField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.ComplexDoubleField.__subclasses__()                        # needs sage.rings.complex_double
      [<class 'sage.rings.complex_double.ComplexDoubleField_class'>]

      >>> len(sage.rings.abc.ComplexDoubleField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.ComplexField

  Bases: `Field`

  Abstract base class for `ComplexField_class`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(CC, sage.rings.abc.ComplexField)                               # needs sage.rings.real_mpfr
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(CC, sage.rings.abc.ComplexField)                               # needs sage.rings.real_mpfr
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.ComplexField.__subclasses__()                              # needs sage.rings.real_mpfr
      [<class 'sage.rings.complex_mpfr.ComplexField_class'>]

      sage: len(sage.rings.abc.ComplexField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.ComplexField.__subclasses__()                              # needs sage.rings.real_mpfr
      [<class 'sage.rings.complex_mpfr.ComplexField_class'>]

      >>> len(sage.rings.abc.ComplexField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.ComplexIntervalField

  Bases: `Field`

  Abstract base class for `ComplexIntervalField_class`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(CIF, sage.rings.abc.ComplexIntervalField)                      # needs sage.rings.complex_interval_field
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(CIF, sage.rings.abc.ComplexIntervalField)                      # needs sage.rings.complex_interval_field
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.ComplexIntervalField.__subclasses__()                      # needs sage.rings.complex_interval_field
      [<class 'sage.rings.complex_interval_field.ComplexIntervalField_class'>]

      sage: len(sage.rings.abc.ComplexIntervalField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.ComplexIntervalField.__subclasses__()                      # needs sage.rings.complex_interval_field
      [<class 'sage.rings.complex_interval_field.ComplexIntervalField_class'>]

      >>> len(sage.rings.abc.ComplexIntervalField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.IntegerModRing

  Bases: `object`

  Abstract base class for `IntegerModRing_generic`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(Integers(7), sage.rings.abc.IntegerModRing)
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(Integers(Integer(7)), sage.rings.abc.IntegerModRing)
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.IntegerModRing.__subclasses__()
      [<class 'sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic'>]

      sage: len(sage.rings.abc.IntegerModRing.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.IntegerModRing.__subclasses__()
      [<class 'sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic'>]

      >>> len(sage.rings.abc.IntegerModRing.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.NumberField_cyclotomic

  Bases: `Field`

  Abstract base class for `NumberField_cyclotomic`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: K.<zeta> = CyclotomicField(15)                                            # needs sage.rings.number_field
      sage: isinstance(K, sage.rings.abc.NumberField_cyclotomic)                      # needs sage.rings.number_field
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> K = CyclotomicField(Integer(15), names=('zeta',)); (zeta,) = K._first_ngens(1)# needs sage.rings.number_field
      >>> isinstance(K, sage.rings.abc.NumberField_cyclotomic)                      # needs sage.rings.number_field
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.NumberField_cyclotomic.__subclasses__()                    # needs sage.rings.number_field
      [<class 'sage.rings.number_field.number_field.NumberField_cyclotomic'>]

      sage: len(sage.rings.abc.NumberField_cyclotomic.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.NumberField_cyclotomic.__subclasses__()                    # needs sage.rings.number_field
      [<class 'sage.rings.number_field.number_field.NumberField_cyclotomic'>]

      >>> len(sage.rings.abc.NumberField_cyclotomic.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.NumberField_quadratic

  Bases: `Field`

  Abstract base class for `NumberField_quadratic`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: K.<sqrt2> = QuadraticField(2)                                             # needs sage.rings.number_field
      sage: isinstance(K, sage.rings.abc.NumberField_quadratic)                       # needs sage.rings.number_field
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> K = QuadraticField(Integer(2), names=('sqrt2',)); (sqrt2,) = K._first_ngens(1)# needs sage.rings.number_field
      >>> isinstance(K, sage.rings.abc.NumberField_quadratic)                       # needs sage.rings.number_field
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.NumberField_quadratic.__subclasses__()                     # needs sage.rings.number_field
      [<class 'sage.rings.number_field.number_field.NumberField_quadratic'>]

      sage: len(sage.rings.abc.NumberField_quadratic.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.NumberField_quadratic.__subclasses__()                     # needs sage.rings.number_field
      [<class 'sage.rings.number_field.number_field.NumberField_quadratic'>]

      >>> len(sage.rings.abc.NumberField_quadratic.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.Order

  Bases: `object`

  Abstract base class for `Order`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: x = polygen(ZZ, 'x')
      sage: K.<a> = NumberField(x^2 + 1); O = K.order(2*a)                            # needs sage.rings.number_field
      sage: isinstance(O, sage.rings.abc.Order)                                       # needs sage.rings.number_field
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> x = polygen(ZZ, 'x')
      >>> K = NumberField(x**Integer(2) + Integer(1), names=('a',)); (a,) = K._first_ngens(1); O = K.order(Integer(2)*a)                            # needs sage.rings.number_field
      >>> isinstance(O, sage.rings.abc.Order)                                       # needs sage.rings.number_field
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.Order.__subclasses__()                                     # needs sage.rings.number_field
      [<class 'sage.rings.number_field.order.Order'>]

      sage: len(sage.rings.abc.Order.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.Order.__subclasses__()                                     # needs sage.rings.number_field
      [<class 'sage.rings.number_field.order.Order'>]

      >>> len(sage.rings.abc.Order.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.RealBallField

  Bases: `Field`

  Abstract base class for `RealBallField`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(RBF, sage.rings.abc.RealBallField)                             # needs sage.libs.flint
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(RBF, sage.rings.abc.RealBallField)                             # needs sage.libs.flint
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.RealBallField.__subclasses__()                             # needs sage.libs.flint
      [<class 'sage.rings.real_arb.RealBallField'>]

      sage: len(sage.rings.abc.RealBallField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.RealBallField.__subclasses__()                             # needs sage.libs.flint
      [<class 'sage.rings.real_arb.RealBallField'>]

      >>> len(sage.rings.abc.RealBallField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.RealDoubleField

  Bases: `Field`

  Abstract base class for `RealDoubleField_class`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(RDF, sage.rings.abc.RealDoubleField)
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(RDF, sage.rings.abc.RealDoubleField)
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.RealDoubleField.__subclasses__()
      [<class 'sage.rings.real_double.RealDoubleField_class'>]

      sage: len(sage.rings.abc.RealDoubleField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.RealDoubleField.__subclasses__()
      [<class 'sage.rings.real_double.RealDoubleField_class'>]

      >>> len(sage.rings.abc.RealDoubleField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.RealField

  Bases: `Field`

  Abstract base class for `RealField_class`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(RR, sage.rings.abc.RealField)                                  # needs sage.rings.real_mpfr
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(RR, sage.rings.abc.RealField)                                  # needs sage.rings.real_mpfr
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.RealField.__subclasses__()                                 # needs sage.rings.real_mpfr
      [<class 'sage.rings.real_mpfr.RealField_class'>]

      sage: len(sage.rings.abc.RealField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.RealField.__subclasses__()                                 # needs sage.rings.real_mpfr
      [<class 'sage.rings.real_mpfr.RealField_class'>]

      >>> len(sage.rings.abc.RealField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.RealIntervalField

  Bases: `Field`

  Abstract base class for `RealIntervalField_class`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(RIF, sage.rings.abc.RealIntervalField)                         # needs sage.rings.real_interval_field
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(RIF, sage.rings.abc.RealIntervalField)                         # needs sage.rings.real_interval_field
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.RealIntervalField.__subclasses__()                         # needs sage.rings.real_interval_field
      [<class 'sage.rings.real_mpfi.RealIntervalField_class'>]

      sage: len(sage.rings.abc.RealIntervalField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.RealIntervalField.__subclasses__()                         # needs sage.rings.real_interval_field
      [<class 'sage.rings.real_mpfi.RealIntervalField_class'>]

      >>> len(sage.rings.abc.RealIntervalField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.SymbolicRing

  Bases: `CommutativeRing`

  Abstract base class for `SymbolicRing`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(SR, sage.rings.abc.SymbolicRing)                               # needs sage.symbolic
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(SR, sage.rings.abc.SymbolicRing)                               # needs sage.symbolic
      True

  By design, other than the abstract subclass `CallableSymbolicExpressionRing`, there is only one direct implementation subclass:

  Sage

      sage: sage.rings.abc.SymbolicRing.__subclasses__()                              # needs sage.symbolic
      [<class 'sage.rings.abc.CallableSymbolicExpressionRing'>,
       <class 'sage.symbolic.ring.SymbolicRing'>]

      sage: len(sage.rings.abc.SymbolicRing.__subclasses__()) <= 2
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.SymbolicRing.__subclasses__()                              # needs sage.symbolic
      [<class 'sage.rings.abc.CallableSymbolicExpressionRing'>,
       <class 'sage.symbolic.ring.SymbolicRing'>]

      >>> len(sage.rings.abc.SymbolicRing.__subclasses__()) <= Integer(2)
      True

class sage.rings.abc.UniversalCyclotomicField

  Bases: `Field`

  Abstract base class for `UniversalCyclotomicField`.

  This class is defined for the purpose of `isinstance()` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: K = UniversalCyclotomicField()                                            # needs sage.libs.gap sage.rings.number_field
      sage: isinstance(K, sage.rings.abc.UniversalCyclotomicField)                    # needs sage.libs.gap sage.rings.number_field
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> K = UniversalCyclotomicField()                                            # needs sage.libs.gap sage.rings.number_field
      >>> isinstance(K, sage.rings.abc.UniversalCyclotomicField)                    # needs sage.libs.gap sage.rings.number_field
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.UniversalCyclotomicField.__subclasses__()                  # needs sage.libs.gap sage.rings.number_field
      [<class 'sage.rings.universal_cyclotomic_field.UniversalCyclotomicField'>]

      sage: len(sage.rings.abc.NumberField_cyclotomic.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.UniversalCyclotomicField.__subclasses__()                  # needs sage.libs.gap sage.rings.number_field
      [<class 'sage.rings.universal_cyclotomic_field.UniversalCyclotomicField'>]

      >>> len(sage.rings.abc.NumberField_cyclotomic.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.pAdicField

  Bases: `Field`

  Abstract base class for `pAdicFieldGeneric`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(Zp(5), sage.rings.abc.pAdicField)                              # needs sage.rings.padics
      False
      sage: isinstance(Qp(5), sage.rings.abc.pAdicField)                              # needs sage.rings.padics
      True

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(Zp(Integer(5)), sage.rings.abc.pAdicField)                              # needs sage.rings.padics
      False
      >>> isinstance(Qp(Integer(5)), sage.rings.abc.pAdicField)                              # needs sage.rings.padics
      True

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.pAdicField.__subclasses__()                                # needs sage.rings.padics
      [<class 'sage.rings.padics.generic_nodes.pAdicFieldGeneric'>]

      sage: len(sage.rings.abc.pAdicField.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.pAdicField.__subclasses__()                                # needs sage.rings.padics
      [<class 'sage.rings.padics.generic_nodes.pAdicFieldGeneric'>]

      >>> len(sage.rings.abc.pAdicField.__subclasses__()) <= Integer(1)
      True

class sage.rings.abc.pAdicRing

  Bases: `CommutativeRing`

  Abstract base class for `pAdicRingGeneric`.

  This class is defined for the purpose of `isinstance` tests. It should not be instantiated.

  EXAMPLES:

  Sage

      sage: import sage.rings.abc
      sage: isinstance(Zp(5), sage.rings.abc.pAdicRing)                               # needs sage.rings.padics
      True
      sage: isinstance(Qp(5), sage.rings.abc.pAdicRing)                               # needs sage.rings.padics
      False

  Python

      >>> from sage.all import *
      >>> import sage.rings.abc
      >>> isinstance(Zp(Integer(5)), sage.rings.abc.pAdicRing)                               # needs sage.rings.padics
      True
      >>> isinstance(Qp(Integer(5)), sage.rings.abc.pAdicRing)                               # needs sage.rings.padics
      False

  By design, there is a unique direct subclass:

  Sage

      sage: sage.rings.abc.pAdicRing.__subclasses__()                                 # needs sage.rings.padics
      [<class 'sage.rings.padics.generic_nodes.pAdicRingGeneric'>]

      sage: len(sage.rings.abc.pAdicRing.__subclasses__()) <= 1
      True

  [Python]

      >>> from sage.all import *
      >>> sage.rings.abc.pAdicRing.__subclasses__()                                 # needs sage.rings.padics
      [<class 'sage.rings.padics.generic_nodes.pAdicRingGeneric'>]

      >>> len(sage.rings.abc.pAdicRing.__subclasses__()) <= Integer(1)
      True