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.Flag.__iter__() is marked as "changed" in Python 3.11, but it's actually new #115106

Closed
finite-state-machine opened this issue Feb 6, 2024 · 1 comment
Labels
docs Documentation in the Doc dir

Comments

@finite-state-machine
Copy link
Contributor

finite-state-machine commented Feb 6, 2024

Documentation

Doc/library/enum.rst near line 537 reads:
screenshot ending with "Changed in version 3.11..."

Flag.__iter__() is new in Python 3.11, as already noted in typeshed and as may be verified using the following script:

from __future__ import annotations
from enum import (
        auto,
        Flag,
        )

class SomeFlag(Flag):

    A = auto()
    B = auto()
    C = auto()

if __name__ == '__main__':

    combined = SomeFlag.A | SomeFlag.B | SomeFlag.C
    # this works in Python 3.11, but not in Python 3.10 (no '__iter__()'
    # method)
    for flag in combined:
        print(flag)

Linked PRs

@finite-state-machine finite-state-machine added the docs Documentation in the Doc dir label Feb 6, 2024
ethanfurman pushed a commit that referenced this issue Feb 7, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 7, 2024
…ython 3.11 (pythonGH-115107)

change versionchanged to versionadded
(cherry picked from commit 3f71c41)

Co-authored-by: Finite State Machine <38001514+finite-state-machine@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 7, 2024
…ython 3.11 (pythonGH-115107)

change versionchanged to versionadded
(cherry picked from commit 3f71c41)

Co-authored-by: Finite State Machine <38001514+finite-state-machine@users.noreply.github.com>
ethanfurman pushed a commit that referenced this issue Feb 8, 2024
…Python 3.11 (GH-115107) (GH-115118)

change versionchanged to versionadded
(cherry picked from commit 3f71c41)

Co-authored-by: Finite State Machine <38001514+finite-state-machine@users.noreply.github.com>
ethanfurman pushed a commit that referenced this issue Feb 8, 2024
…Python 3.11 (GH-115107) (GH-115117)

change versionchanged to versionadded
(cherry picked from commit 3f71c41)

Co-authored-by: Finite State Machine <38001514+finite-state-machine@users.noreply.github.com>
@sobolevn
Copy link
Member

sobolevn commented Feb 9, 2024

Thanks!

@sobolevn sobolevn closed this as completed Feb 9, 2024
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this issue Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants