Symbols are cached by name and assumptions, and like everything else in SymPy, are immutable. Thus:
In [1]: a = symbols('a') In [2]: a2 = symbols('a', positive=True) In [3]: a is a2 Out[3]: False In [4]: hash(a) == hash(a2) Out[4]: False So no, you should have no problems with assumptions. On Thu, Apr 2, 2015 at 11:54 AM, Joachim Durchholz <j...@durchholz.org> wrote: > Am 02.04.2015 um 18:46 schrieb James Crist: > >> >> >>> Performance: >>> Using symbols() in all contexts might have performance ramifications, >>> creating new Symbol() objects means more memory pressure than reusing >>> precreated symbols from sympy.abc (which happen 521 times in SymPy >>> itself, hopefully just in test code). >>> >>> >> We cache symbol creation, so Symbol('a') is Symbol('a') is True. This >> means >> no additional memory is consumed. >> > > Ah, I wasn't aware of that. > What happens with assumptions - do these persist? (I'm a bit worried about > tests here.) > > -- > You received this message because you are subscribed to a topic in the > Google Groups "sympy" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/sympy/dbOIFUeec3s/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > sympy+unsubscr...@googlegroups.com. > To post to this group, send email to sympy@googlegroups.com. > 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/551D7457.6000306%40durchholz.org. > > For more options, visit https://groups.google.com/d/optout. > -- 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 sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. 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/CAJ2L7mdUnokdz9AiVY_v4d9akVwiTYa3e%2BkN-NZv_kf4hdiYhw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.