Pursuant to Upabjojr's comments
(https://github.com/sympy/sympy/pull/2237/files#r5289892), I've updated
some bits of my code to use the __new__ function instead of __init__. For
example in cartan_type.py, in class Standard_Cartan, I have a __new__
method which goes as
class Standard_Cartan(Basic):
def __new__(cls, series, n):
obj = Basic.__new__(cls, series, n)
obj.n = n
obj.series = series
return obj
And then in type_a (just an example, I've changed it in all the cases), I
have
class TypeA(Standard_Cartan):
def __new__(cls, n):
assert n >= 1
return Standard_Cartan.__new__(cls, "A", n)
I did this to conform with Sympy standards, but I also thought that this
would fix the problems with test_args. However, if I set
obj = Standard_Cartan("A", 2) and run
print [isinstance(arg, Basic) for arg in obj.args]
I still get [False, False] as output. So, perhaps I am misunderstanding
what is going on with the new __new__ method, but I thought that now
Standard_Cartan would be a Basic object like it should be? Could anyone
clarify what is going on here?
Mary
--
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.
For more options, visit https://groups.google.com/groups/opt_out.