On Tue, Apr 25, 2017 at 3:17 AM, Francesco Bonazzi <[email protected]>
wrote:
>
> On Tuesday, 25 April 2017 01:32:30 UTC+2, Aaron Meurer wrote:
>
>> 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).
>>
>
>
> I don't think this is an issue, as adding the attributes would be
> associated to all instances of an object that have the same args. So an
> update to *_hashable_content* would not be necessary.
>
But what's the value of making attributes global instead of local? It would
seem that you could just end up breaking things, if some other code has a
reference to the same object used for a different purpose.
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/ms
>>> gid/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/a6f65711-6317-466c-8eda-d65caf0814f7%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/a6f65711-6317-466c-8eda-d65caf0814f7%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%3D6KgBHQ%2BrA9Ec6p9E%2BsidxM%2BtA%3DY2ATG1UTBKz0RCJW%2Bow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.