You could model it after the assumptions. I don't think you can reuse the
assumptions dictionary because they can only be boolean values.
But way that Symbol('x') != Symbol('x', real=True) works is that Symbol
defines _hashable_content which includes the assumptions dictionary. As
long as you include the attributes in the _hashable_content, I believe it
should work, at least for args == () objects (if there nonempty args it may
be more complicated).
Aaron Meurer
On Thu, Apr 20, 2017 at 4:37 PM, Francesco Bonazzi <[email protected]>
wrote:
>
>
> On Thursday, 20 April 2017 21:00:47 UTC+2, Aaron Meurer wrote:
>>
>> 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.
>>
>
>
> This argument arose as we need to put the same argument in different
> objects. For example, the introduction of an offset for indexed objects
> should affect both IndexedBase and Array, but should we add a new argument
> in __new__ to all of them? I believe that only defining arguments should be
> put in the arguments, while we need some extra space to put non-defining
> information associated to objects (for example, the way you want the
> printer to behave on them, you might also want to change it after the
> objects have been defined).
>
> Don't the new-style assumptions have a global dictionary as a support?
>
> --
> 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/04e21a30-0686-4b65-93b3-edee0f989056%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/04e21a30-0686-4b65-93b3-edee0f989056%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> 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%3D6LnKCuLwt_F5DAJW5%3DTxuwa7wvULersgeNNLUFN-x%2BaPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.