This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: [Enum] update __contains__ to return True for valid values
Type: behavior Stage: resolved
Components: Versions: Python 3.10
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ethan.furman Nosy List: ethan.furman, pablogsal
Priority: normal Keywords: patch

Created on 2021-04-27 19:11 by ethan.furman, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25670 merged ethan.furman, 2021-04-27 20:04
PR 25770 merged pablogsal, 2021-05-01 02:07
Messages (4)
msg392122 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2021-04-27 19:11
In 3.12 `__contains__` will check for both members and values:

    Color.RED in Color  --> True
    1 in Color          --> True
    'RED' in Color      --> False

Add DeprecationWarning for now.
msg392127 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2021-04-27 20:05
New changeset 6bd9288b805c765ec2433f66aa4d82e05767325f by Ethan Furman in branch 'master':
bpo-43957: [Enum] Deprecate ``TypeError`` from containment checks. (GH-25670)
msg392622 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-05-01 19:26
New changeset 9a42d5069a4c2a531076abfb198d2be26b57216c by Pablo Galindo in branch 'master':
bpo-43957: Add a missins space to the new format enum warning (#25770)
msg392633 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-05-01 20:33
Ethan can we close this issue?
Date User Action Args
2022-04-11 14:59:44adminsetgithub: 88123
2021-05-01 20:39:22ethan.furmansetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-05-01 20:33:38pablogsalsetmessages: + msg392633
2021-05-01 19:26:15pablogsalsetmessages: + msg392622
2021-05-01 02:07:43pablogsalsetnosy: + pablogsal
pull_requests: + pull_request24463
2021-04-27 20:05:15ethan.furmansetmessages: + msg392127
2021-04-27 20:04:10ethan.furmansetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request24361
2021-04-27 19:11:08ethan.furmancreate