Skip to content

Commit bd306f6

Browse files
authored
Use assignment instead of annotation in third party enums (#11957)
1 parent 5bd7150 commit bd306f6

File tree

7 files changed

+58
-58
lines changed

7 files changed

+58
-58
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from enum import IntEnum
22

33
class ATNType(IntEnum):
4-
LEXER: int
5-
PARSER: int
4+
LEXER = 0
5+
PARSER = 1
66
@classmethod
77
def fromOrdinal(cls, i: int): ...

stubs/antlr4-python3-runtime/antlr4/atn/LexerAction.pyi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ from enum import IntEnum
44
Lexer: Incomplete
55

66
class LexerActionType(IntEnum):
7-
CHANNEL: int
8-
CUSTOM: int
9-
MODE: int
10-
MORE: int
11-
POP_MODE: int
12-
PUSH_MODE: int
13-
SKIP: int
14-
TYPE: int
7+
CHANNEL = 0
8+
CUSTOM = 1
9+
MODE = 2
10+
MORE = 3
11+
POP_MODE = 4
12+
PUSH_MODE = 5
13+
SKIP = 6
14+
TYPE = 7
1515

1616
class LexerAction:
1717
actionType: Incomplete

stubs/antlr4-python3-runtime/antlr4/atn/PredictionMode.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ from antlr4.atn.ATNState import RuleStopState as RuleStopState
88
from antlr4.atn.SemanticContext import SemanticContext as SemanticContext
99

1010
class PredictionMode(Enum):
11-
SLL: int
12-
LL: int
13-
LL_EXACT_AMBIG_DETECTION: int
11+
SLL = 0
12+
LL = 1
13+
LL_EXACT_AMBIG_DETECTION = 2
1414
@classmethod
1515
def hasSLLConflictTerminatingPrediction(cls, mode: PredictionMode, configs: ATNConfigSet): ...
1616
@classmethod

stubs/flake8/flake8/options/manager.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ from _typeshed import Incomplete
33
from collections.abc import Callable, Sequence
44
from enum import Enum
55
from logging import Logger
6-
from typing import Any, Final
6+
from typing import Any
77

88
from ..plugins.finder import Plugins
99

1010
LOG: Logger
1111

1212
class _ARG(Enum):
13-
NO: Final = 1
13+
NO = 1
1414

1515
class Option:
1616
short_option_name: Incomplete

stubs/flake8/flake8/style_guide.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ from .statistics import Statistics
99
__all__ = ("StyleGuide",)
1010

1111
class Selected(enum.Enum):
12-
Explicitly: str
13-
Implicitly: str
12+
Explicitly = "explicitly selected"
13+
Implicitly = "implicitly selected"
1414

1515
class Ignored(enum.Enum):
16-
Explicitly: str
17-
Implicitly: str
16+
Explicitly = "explicitly ignored"
17+
Implicitly = "implicitly ignored"
1818

1919
class Decision(enum.Enum):
20-
Ignored: str
21-
Selected: str
20+
Ignored = "ignored error"
21+
Selected = "selected error"
2222

2323
class DecisionEngine:
2424
cache: Incomplete

stubs/fpdf2/fpdf/enums.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ class TableCellFillMode(CoerciveEnum):
7777
def should_fill_cell(self, i: int, j: int) -> bool: ...
7878

7979
class TableSpan(CoerciveEnum):
80-
ROW: Literal["ROW"]
81-
COL: Literal["COL"]
80+
ROW = "ROW"
81+
COL = "COL"
8282

8383
class TableHeadingsDisplay(CoerciveIntEnum):
8484
NONE = 0

stubs/regex/regex/_regex_core.pyi

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -44,42 +44,42 @@ class RegexFlag(enum.IntFlag):
4444
X = 0x40
4545
VERBOSE = X
4646

47-
A: int
48-
ASCII: int
49-
B: int
50-
BESTMATCH: int
51-
D: int
52-
DEBUG: int
53-
E: int
54-
ENHANCEMATCH: int
55-
F: int
56-
FULLCASE: int
57-
I: int
58-
IGNORECASE: int
59-
L: int
60-
LOCALE: int
61-
M: int
62-
MULTILINE: int
63-
P: int
64-
POSIX: int
65-
R: int
66-
REVERSE: int
67-
T: int
68-
TEMPLATE: int
69-
S: int
70-
DOTALL: int
71-
U: int
72-
UNICODE: int
73-
V0: int
74-
VERSION0: int
75-
V1: int
76-
VERSION1: int
77-
W: int
78-
WORD: int
79-
X: int
80-
VERBOSE: int
47+
A = RegexFlag.A
48+
ASCII = RegexFlag.ASCII
49+
B = RegexFlag.B
50+
BESTMATCH = RegexFlag.BESTMATCH
51+
D = RegexFlag.D
52+
DEBUG = RegexFlag.DEBUG
53+
E = RegexFlag.E
54+
ENHANCEMATCH = RegexFlag.ENHANCEMATCH
55+
F = RegexFlag.F
56+
FULLCASE = RegexFlag.FULLCASE
57+
I = RegexFlag.I
58+
IGNORECASE = RegexFlag.IGNORECASE
59+
L = RegexFlag.L
60+
LOCALE = RegexFlag.LOCALE
61+
M = RegexFlag.M
62+
MULTILINE = RegexFlag.MULTILINE
63+
P = RegexFlag.P
64+
POSIX = RegexFlag.POSIX
65+
R = RegexFlag.R
66+
REVERSE = RegexFlag.REVERSE
67+
T = RegexFlag.T
68+
TEMPLATE = RegexFlag.TEMPLATE
69+
S = RegexFlag.S
70+
DOTALL = RegexFlag.DOTALL
71+
U = RegexFlag.U
72+
UNICODE = RegexFlag.UNICODE
73+
V0 = RegexFlag.V0
74+
VERSION0 = RegexFlag.VERSION0
75+
V1 = RegexFlag.V1
76+
VERSION1 = RegexFlag.VERSION1
77+
W = RegexFlag.W
78+
WORD = RegexFlag.WORD
79+
X = RegexFlag.X
80+
VERBOSE = RegexFlag.VERBOSE
8181

82-
DEFAULT_VERSION: int
82+
DEFAULT_VERSION: RegexFlag
8383

8484
_Lexicon: TypeAlias = list[tuple[AnyStr, Callable[[Scanner[AnyStr], AnyStr], Any]]]
8585

0 commit comments

Comments
 (0)