Guest6930 has quit [Killed (platinum.libera.chat (Nickname regained by services))]
jinsun__ has joined #pypy
lehmrob has quit [Ping timeout: 256 seconds]
<arigato>
note that it might be relevant or not, but with numpy there are subclasses of float involved, and in pypy I think that if F is a subclass of float, F('nan') is not F('nan')
<arigato>
in other words---again someone needs to check this---maybe in cpython 3.10, "class F(float):pass; put many F('nan') in a dict" runs in linear time, whereas it runs in quadratic time in pypy
<arigato>
the fix would be that float.__hash__ should return an identity-based result if 'self' is a subclass of float whose value is NaN
<arigato>
but only for subclasses, in pypy
<arigato>
whereas if I'm getting right in cpython 3.10 it's done for float too (and subclasses)
Atque has quit [Ping timeout: 255 seconds]
Atque has joined #pypy
Atque has quit [Remote host closed the connection]
Atque has joined #pypy
lehmrob has joined #pypy
<cfbolz>
arigato: ah, that's a good point, thank you
lehmrob has quit [Ping timeout: 264 seconds]
<cfbolz>
arigato: this should somehow even go to pypy2, right?
<arigato>
I don't think so? it's for a case where cpython is quadratic before 3.10, and it's risky to change the hash of some floats to become essentially random numbers
<cfbolz>
ok, makes sense
<cfbolz>
arigato: only for subclasses of floats that store NaNs, but yes
<arigato>
right, only for subclasses, but still yes :-) I think we behave really like cpython for subclasses of float (so we should change the hash for subclasses of float in 3.10 just like cpython)
<cfbolz>
ok
<mattip>
we would have to inject a new float_hash function into the subclass typedef when creating the subclass,
<mattip>
but only if it didn't define its own __hash__
Cheery has quit [Ping timeout: 268 seconds]
Cheery has joined #pypy
luckydonald has quit [Ping timeout: 246 seconds]
luckydonald has joined #pypy
Atque has quit [Ping timeout: 255 seconds]
Atque has joined #pypy
epony has quit [*.net *.split]
energizer has quit [*.net *.split]
the_rat_ has quit [*.net *.split]
mannerism has quit [*.net *.split]
atomizer has quit [*.net *.split]
hexology has quit [*.net *.split]
hexology has joined #pypy
energizer has joined #pypy
the_rat_ has joined #pypy
mannerism has joined #pypy
epony has joined #pypy
atomizer has joined #pypy
epony has quit [Max SendQ exceeded]
epony has joined #pypy
epony has quit [Remote host closed the connection]