-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Closed
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
Documentation
Doc/library/enum.rst near line 537 reads:

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
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir