Hi!

On 2016-10-07, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote:
> On 2016-10-07 13:35, Johan S. H. Rosenkilde wrote:
>> The implementation of __hash__ on finite fields claims to be the same as
>> for 'object'.
>
> Could be:
>
> $ sage -c 'print(hash(object()))'
> 8790924175895
> $ sage -c 'print(hash(object()))'
> 8771665328407

Indeed, if I am not mistaken, the hash of object() relies on the address
in memory. Which is fine, because by default comparison of objects is by
identity (i.e., by memory address).

And on finite fields, it is fine as long as elements of finite fields
are cached (which is the case for small-enough fields) and the fields
themselves are unique parents:
  sage: GF(17)(3) is GF(17)(3)
  True

Best regards,
Simon

-- 
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