[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Joshua Bronson
Joshua Bronson added the comment: Thanks for the explanation, Raymond. Regarding: > Lastly, pure python hashable sets based on the ABC are not common This would have implications for other use cases though, that are perhaps more common. See, for example, the following code: https://github

[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Why not expose the C implementation via a frozenset._hash() > classmethod, and change Set._hash() to merely call that? The frozenset.__hash__ method is tightly bound to the internals of real sets to take advantage of the hash values already being known f

[issue46684] Expose frozenset._hash classmethod

2022-02-08 Thread Joshua Bronson
New submission from Joshua Bronson : collections.abc.Set provides a _hash() method that includes the following in its docstring: """ Note that we don't define __hash__: not all sets are hashable. But if you define a hashable set type, its __hash__ should call this function. ... We match the al