Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/rings/commutative_ring_element.py
8817 views
1
"""
2
Base class for commutative ring elements
3
"""
4
5
#*****************************************************************************
6
# Copyright (C) 2005 William Stein <[email protected]>
7
#
8
# Distributed under the terms of the GNU General Public License (GPL)
9
#
10
# This code is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
# General Public License for more details.
14
#
15
# The full text of the GPL is available at:
16
#
17
# http://www.gnu.org/licenses/
18
#*****************************************************************************
19
20
from sage.structure.element import CommutativeRingElement
21
22
def is_CommutativeRingElement(x):
23
"""
24
Check to see if ``x`` is a :class:`CommutativeRingElement`.
25
26
EXAMPLES::
27
28
sage: sage.rings.commutative_ring_element.is_CommutativeRingElement(ZZ(2))
29
True
30
"""
31
return isinstance(x, CommutativeRingElement)
32
33