Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enum] update __contains__ to return True for valid values #88123

Closed
ethanfurman opened this issue Apr 27, 2021 · 4 comments
Closed

[Enum] update __contains__ to return True for valid values #88123

ethanfurman opened this issue Apr 27, 2021 · 4 comments
Assignees
Labels
3.10 type-bug

Comments

@ethanfurman
Copy link
Member

@ethanfurman ethanfurman commented Apr 27, 2021

BPO 43957
Nosy @ethanfurman, @pablogsal
PRs
  • #25670
  • #25770
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ethanfurman'
    closed_at = <Date 2021-05-01.20:39:22.594>
    created_at = <Date 2021-04-27.19:11:08.744>
    labels = ['type-bug', '3.10']
    title = '[Enum] update __contains__ to return True for valid values'
    updated_at = <Date 2021-05-01.20:39:22.594>
    user = 'https://github.com/ethanfurman'

    bugs.python.org fields:

    activity = <Date 2021-05-01.20:39:22.594>
    actor = 'ethan.furman'
    assignee = 'ethan.furman'
    closed = True
    closed_date = <Date 2021-05-01.20:39:22.594>
    closer = 'ethan.furman'
    components = []
    creation = <Date 2021-04-27.19:11:08.744>
    creator = 'ethan.furman'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43957
    keywords = ['patch']
    message_count = 4.0
    messages = ['392122', '392127', '392622', '392633']
    nosy_count = 2.0
    nosy_names = ['ethan.furman', 'pablogsal']
    pr_nums = ['25670', '25770']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue43957'
    versions = ['Python 3.10']

    @ethanfurman
    Copy link
    Member Author

    @ethanfurman ethanfurman commented Apr 27, 2021

    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.

    @ethanfurman ethanfurman self-assigned this Apr 27, 2021
    @ethanfurman ethanfurman added type-bug 3.10 labels Apr 27, 2021
    @ethanfurman ethanfurman self-assigned this Apr 27, 2021
    @ethanfurman ethanfurman added the type-bug label Apr 27, 2021
    @ethanfurman
    Copy link
    Member Author

    @ethanfurman ethanfurman commented Apr 27, 2021

    New changeset 6bd9288 by Ethan Furman in branch 'master':
    bpo-43957: [Enum] Deprecate TypeError from containment checks. (GH-25670)
    6bd9288

    @pablogsal
    Copy link
    Member

    @pablogsal pablogsal commented May 1, 2021

    New changeset 9a42d50 by Pablo Galindo in branch 'master':
    bpo-43957: Add a missins space to the new format enum warning (bpo-25770)
    9a42d50

    @pablogsal
    Copy link
    Member

    @pablogsal pablogsal commented May 1, 2021

    Ethan can we close this issue?

    @ethanfurman ethanfurman closed this May 1, 2021
    @ethanfurman ethanfurman closed this May 1, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 type-bug
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants