On Sunday, 27 September 2015 00:34:20 UTC+2, Aaron Meurer wrote: > > What is PartReplace supposed to do? For me it just returns the > replacement. > > I updated the gist to make it act as a replacement:
In [14]: PartReplace(x*y+z, w, 1,1) Out[14]: w⋅x + z This should basically act to replace element at position *.args[1].args[1]* with *w*. Of couse I avoided using the syntax *expr.args[1].args[1] = w* to comply with SymPy's immutability of objects. In [15]: (x*y+z).args[1].args[1] Out[15]: y This gets element at (1,1), or the equivalent form in my gist: In [18]: Part((x*y+z), 1, 1) Out[18]: y I think that *Basic* could be equipped with these two methods. -- 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/5d162736-8680-41c5-9f1a-8ce799da1708%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
