Why do they need to be set in a global dictionary?

You can already set whatever attributes you want on an atomic object.
So long as __eq__ checks against them it should work. I usually
recommend storing things in args if you can, as it makes things a lot
simpler, but it isn't required, at least for args == () objects.

Aaron Meurer

On Thu, Apr 20, 2017 at 9:33 AM, Francesco Bonazzi
<[email protected]> wrote:
> Do you think it could make sense to have attributes for atoms in SymPy?
>
> Sometimes it could be convenient to store information on certain
> expressions, like SymPy atoms.
>
> It came into the discussion of:
> https://github.com/sympy/sympy/pull/12490
>
> In this PR, IndexedBase is being loaded with more arguments. Potentially
> more arguments could be added in the future and through different kinds of
> objects (arrays and matrices could also be assigned the attributes discussed
> in that PR).
>
> In Mathematica, atttributes are supported:
>
> https://reference.wolfram.com/language/ref/SetAttributes.html
> https://reference.wolfram.com/language/ref/Attributes.html
>
>
> In Mathematica only a limited set of attributes can be assigned, and it's
> generally about basic mathematical behaviour.
>
>
> We could potentially have a dictionary or a set assigned to atoms in a
> hidden global dictionary in sympy.core. What do you think?
>
>
>
> --
> 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 https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/b4a612ef-7756-447b-996a-865fc9dd5968%40googlegroups.com.
> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6JBNFL1P_7m--mNEJ0wciHA3cicuVrVn8NrPwjPbhSHSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to