-
-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #34804: Deprecate sage.interfaces is_...Element functions
Introducing a module `sage.interfaces.abc` with abstract base classes for `isinstance` testing (see https://doc.sagemath.org/html/en/developer/packaging_sage_library.html #module-level-runtime-dependencies) Part of #32414 URL: https://trac.sagemath.org/34804 Reported by: mkoeppe Ticket author(s): Matthias Koeppe, Dima Pasechnik Reviewer(s): Dima Pasechnik
- Loading branch information
Showing
29 changed files
with
346 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,138 @@ | ||
r""" | ||
Abstract base classes for interface elements | ||
""" | ||
|
||
class AxiomElement: | ||
r""" | ||
Abstract base class for :class:`~sage.interfaces.axiom.AxiomElement`. | ||
This class is defined for the purpose of ``isinstance`` tests. It should not be | ||
instantiated. | ||
EXAMPLES: | ||
By design, there is a unique direct subclass:: | ||
sage: len(sage.interfaces.abc.AxiomElement.__subclasses__()) <= 1 | ||
True | ||
""" | ||
pass | ||
|
||
|
||
class ExpectElement: | ||
r""" | ||
Abstract base class for :class:`~sage.interfaces.expect.ExpectElement`. | ||
This class is defined for the purpose of ``isinstance`` tests. It should not be | ||
instantiated. | ||
EXAMPLES: | ||
By design, there is a unique direct subclass:: | ||
sage: len(sage.interfaces.abc.ExpectElement.__subclasses__()) <= 1 | ||
True | ||
""" | ||
pass | ||
|
||
|
||
class FriCASElement: | ||
r""" | ||
Abstract base class for :class:`~sage.interfaces.fricas.FriCASElement`. | ||
This class is defined for the purpose of ``isinstance`` tests. It should not be | ||
instantiated. | ||
EXAMPLES: | ||
By design, there is a unique direct subclass:: | ||
sage: len(sage.interfaces.abc.FriCASElement.__subclasses__()) <= 1 | ||
True | ||
""" | ||
pass | ||
|
||
|
||
class GapElement: | ||
r""" | ||
Abstract base class for :class:`~sage.interfaces.gap.GapElement`. | ||
This class is defined for the purpose of ``isinstance`` tests. It should not be | ||
instantiated. | ||
EXAMPLES: | ||
By design, there is a unique direct subclass:: | ||
sage: len(sage.interfaces.abc.GapElement.__subclasses__()) <= 1 | ||
True | ||
""" | ||
pass | ||
|
||
|
||
class GpElement: | ||
r""" | ||
Abstract base class for :class:`~sage.interfaces.gp.GpElement`. | ||
This class is defined for the purpose of ``isinstance`` tests. It should not be | ||
instantiated. | ||
EXAMPLES: | ||
By design, there is a unique direct subclass:: | ||
sage: len(sage.interfaces.abc.GpElement.__subclasses__()) <= 1 | ||
True | ||
""" | ||
pass | ||
|
||
|
||
class Macaulay2Element: | ||
r""" | ||
Abstract base class for :class:`~sage.interfaces.macaulay2.Macaulay2Element`. | ||
This class is defined for the purpose of ``isinstance`` tests. It should not be | ||
instantiated. | ||
EXAMPLES: | ||
By design, there is a unique direct subclass:: | ||
sage: len(sage.interfaces.abc.Macaulay2Element.__subclasses__()) <= 1 | ||
True | ||
""" | ||
pass | ||
|
||
|
||
class MagmaElement: | ||
r""" | ||
Abstract base class for :class:`~sage.interfaces.magma.MagmaElement`. | ||
This class is defined for the purpose of ``isinstance`` tests. It should not be | ||
instantiated. | ||
EXAMPLES: | ||
By design, there is a unique direct subclass:: | ||
sage: len(sage.interfaces.abc.MagmaElement.__subclasses__()) <= 1 | ||
True | ||
""" | ||
pass | ||
|
||
|
||
class SingularElement: | ||
r""" | ||
Abstract base class for :class:`~sage.interfaces.singular.SingularElement`. | ||
This class is defined for the purpose of ``isinstance`` tests. It should not be | ||
instantiated. | ||
EXAMPLES: | ||
By design, there is a unique direct subclass:: | ||
sage: len(sage.interfaces.abc.SingularElement.__subclasses__()) <= 1 | ||
True | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.