def __new__(cls, name, **assumptions):
"""Symbols are identified by name and assumptions::
>>> from sympy import Symbol
>>> Symbol("x") == Symbol("x")
True
>>> Symbol("x", real=True) == Symbol("x", real=False)
False
"""
if assumptions.get('zero', False):
return S.Zero
is_commutative = fuzzy_bool(assumptions.get('commutative', True))
if is_commutative is None:
raise ValueError(
'''Symbol commutativity must be True or False.''')
I was studying how declaration of Symbol works with the help of winpdb .
`name` is for the name of symbol and `assumptions` are the assumptions
associated with it .
What about the cls variable , I didn't understand it's use and what does
assumptions.get('zero',False) mean ?
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/bb422c28-72f1-46d5-8df5-60d331140503%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.