> > (how often is the first 
> > thing you do is verify the object has a compatible type?). 
>
> Almost never, at least for elements! 
>
> For elements (not for parents, though), one is supposed to 
> implement single underscore arithmetic *and* comparison methods, 
> which will only be called after coercion took place and so the 
> two arguments of _richcmp_ are guaranteed to belong to the 
> same parent. 
>
> So, verifying that the types are compatible only applies to 
> the rare case that elements of a single parent are implemented 
> by different types, simultaneously. Just never ever override 
> double underscore __richtcmp__ for elements. 
>
> Yes, that is a very good point to make and reinforce.

Best,
Travis

 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to