[New-bugs-announce] [issue39046] collections.abc.Reversible should not be a subclass of Hashable

Zac Hatfield-Dodds report at bugs.python.org
Sat Dec 14 05:04:07 EST 2019


New submission from Zac Hatfield-Dodds <zac.hatfield.dodds at gmail.com>:

>>> from collections.abc import Hashable, Reversible
>>> assert issubclass(Reversible, Hashable)

However, this is trivially wrong - lists are Reversible but not Hashable, and there is no reason to thing that reversible objects should all be hashable.

The versions of these classes in the typing module have the same problem.

----------
components: Library (Lib)
messages: 358386
nosy: Zac Hatfield-Dodds
priority: normal
severity: normal
status: open
title: collections.abc.Reversible should not be a subclass of Hashable
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39046>
_______________________________________


More information about the New-bugs-announce mailing list