On Sunday, March 30, 2014 4:09:47 PM UTC+2, Stefan Krastanov wrote:
>
> Here is an example why `__eq__` should correspond to structural equality: 
>
> >>> class a(object): 
> ...     def __eq__(self, other): 
> ...         raise NotImplementedError() 
> ... 
>
> >>> i = a() 
>
> >>> list = [1,2,3,i] 
>
> >>> list.index(i) 
> Traceback (most recent call last): 
>   File "<stdin>", line 1, in <module> 
>   File "<stdin>", line 3, in __eq__ 
> NotImplementedError 
>
>
>
> __eq__ is part of basic python protocols, we should not  make it do 
> other things.
>

OK, so as soon as the currently pending PR is merged, I'll try to address 
this issue.

I think that the problem can be solved by renaming __eq__ to _eval_Eq and 
then solving all issues of confusion around.

-- 
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/01ec463d-3039-4e19-8702-8cc6c6a87ccf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to