I guess that the problem is that you are changing the class attribute instead of the instance_of_the_class attribute. If you are working within a __new__ method it is a bit confusing to sort them out, but in most methods you usually work with the instance attributes through the `self` variable.
I do not have a nice reference, but you can try to search for more information on resolution of attributes in python, i.e. when an attribute of a instance or an attribute of a class is invoked. You can play around by defining attributes within __init__ or __new__ or just in the body of the class to learn the differences in the behavior. On 5 March 2013 22:40, Bi Ge <[email protected]> wrote: > Sorry I was confused by the cls. The original eval method has 3 inputs(cls, > i, j). > To use ._args I just need to do `cls._args` right? > > If so, right now even I reassign it to some other value the class stays > unchanged. > > type(cls._args) gives `<type 'member_descriptor'>` > and `print cls._args` gives `<member '_args' of 'Basic' objects>` > > On Tuesday, March 5, 2013 4:07:56 PM UTC-5, Stefan Krastanov wrote: >> >> Is there a reason not to use the following? >> >> `self._args = sorting_function(self._args)` >> >> I think it is used in some other places which need similar treatment. >> >> I did not understand the question about `eval`. Why do you need to >> define an `eval` method? > > -- > 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?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
