You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rephrase general rules for comparison of objects #141218
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}
True
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.
Activity
pythongh-141218: Fix inaccurate object comparison documentation
picnixz commentedon Nov 15, 2025
A PR already exists so there is nothing else to do.
gh-141218: Fix inaccurate object comparison documentation (#141221)
pythongh-141218: Fix inaccurate object comparison documentation (pyth…
pythongh-141218: Fix inaccurate object comparison documentation (pyth…
[3.14] gh-141218: Fix inaccurate object comparison documentation (GH-…
[3.13] gh-141218: Fix inaccurate object comparison documentation (GH-…
picnixz commentedon Jan 7, 2026
I think we can close this right @skirpichev?