-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Description
Right now we have this in docs:
Objects of different types, except different numeric types, never compare equal.
This is not true for a long time, e.g. frozenset's vs set's - another exception:
Python 3.14.0 (tags/v3.14.0:ebf955df7a8, Oct 15 2025, 06:24:48) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> frozenset([1, 2]) == {1, 2}
TrueIn the relevant place of docs its documented:
Both set and frozenset support set to set comparisons. Two sets are equal if and only if every element of each set is contained in the other (each is a subset of the other). A set is less than another set if and only if the first set is a proper subset of the second set (is a subset, but is not equal). A set is greater than another set if and only if the first set is a proper superset of the second set (is a superset, but is not equal).
Instances of set are compared to instances of frozenset based on their members.
but we should adjust also the generic texts, something like:
Objects of different types, unless documented otherwise, never compare equal.
PS: https://discuss.python.org/t/104658/
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status