[issue45832] Misleading membersip expression documentation

2021-11-20 Thread Harald Husum
Harald Husum added the comment: Serhiy, thanks for responding. I agree on this being "third-party" when looking at the original post I made, and I've reported the issue to the relevant party (https://github.com/pandas-dev/pandas/issues/44504). But really, the bigger issue here, in my opinio

[issue45832] Misleading membersip expression documentation

2021-11-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think there is a bug in either numpy.timedelta64.__hash__ or panda.Timedelta.__hash__. Please report it to corresponding libraries. It is not related to the documentation of membership test. If you have different hashes for equal objects most dict and se

[issue45832] Misleading membersip expression documentation

2021-11-19 Thread Harald Husum
Change by Harald Husum : -- versions: +Python 3.10 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45832] Misleading membersip expression documentation

2021-11-18 Thread Harald Husum
Harald Husum added the comment: I am realising that me not knowing about the hash invariance is likely a symptom of something I have in common with most Python users, but not with Python maintainers: Having access to a powerful ecosystem, we mostly get our classes from 3rd parties, rather th

[issue45832] Misleading membersip expression documentation

2021-11-17 Thread Harald Husum
Harald Husum added the comment: Might i then suggest mentioning in the docs that this assumes the invariance, combined with a backlink to the definition, instead of a full repeat? I'm sure the hash invariant is well known to you guys, working on python, but I was genuinely surprised by this

[issue45832] Misleading membersip expression documentation

2021-11-17 Thread Eric V. Smith
Eric V. Smith added the comment: I don’t think repeating the hash invariant in multiple places adds anything, I think it would just add clutter. I also think the existing docs are easier to understand than the version with the hashing containers split out. -- nosy: +eric.smith __

[issue45832] Misleading membersip expression documentation

2021-11-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: This section presumes that the usual hash invariant holds: a==b implies hash(a)==hash(b). We could repeat that here but I don't think it makes the docs better or more useable to require that docs repeat the same facts in multiple places. Alternatively,

[issue45832] Misleading membersip expression documentation

2021-11-17 Thread Harald Husum
New submission from Harald Husum : https://docs.python.org/3/reference/expressions.html#membership-test-operations > For container types such as list, tuple, set, frozenset, dict, or > collections.deque, the expression `x in y` is equivalent to `any(x is e or x > == e for e in y)`. Yet: ```