Skip to content

Commit 2a9ffaa

Browse files
rename CommonConstants to CommonConstant
1 parent c78f391 commit 2a9ffaa

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/bytecode/concrete.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
BaseInstr,
4343
BinaryOp,
4444
CellVar,
45-
CommonConstants,
45+
CommonConstant,
4646
Compare,
4747
FormatValue,
4848
FreeVar,
@@ -1096,7 +1096,7 @@ def to_bytecode(
10961096
elif opcode in BINARY_OPS:
10971097
arg = BinaryOp(c_arg)
10981098
elif opcode in COMMON_CONSTANT_OPS:
1099-
arg = CommonConstants(c_arg)
1099+
arg = CommonConstant(c_arg)
11001100
elif opcode in SPECIAL_OPS:
11011101
arg = SpecialMethod(c_arg)
11021102
elif opcode in FORMAT_VALUE_OPS:

src/bytecode/instr.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class SpecialMethod(enum.IntEnum):
209209

210210

211211
@enum.unique
212-
class CommonConstants(enum.IntEnum):
212+
class CommonConstant(enum.IntEnum):
213213
"""Common constants names used with LOAD_COMMON_CONSTANT"""
214214

215215
ASSERTION_ERROR = 0
@@ -872,7 +872,7 @@ def _cmp_key(self) -> Tuple[Optional[InstrLocation], str, Any]:
872872
BinaryOp,
873873
Intrinsic1Op,
874874
Intrinsic2Op,
875-
CommonConstants,
875+
CommonConstant,
876876
SpecialMethod,
877877
Tuple[bool, str],
878878
Tuple[bool, bool, str],
@@ -1034,10 +1034,10 @@ def _check_arg(self, name: str, opcode: int, arg: InstrArg) -> None:
10341034
"SpecialMethod, got %s" % (name, type(arg).__name__)
10351035
)
10361036
elif opcode in COMMON_CONSTANT_OPS:
1037-
if not isinstance(arg, CommonConstants):
1037+
if not isinstance(arg, CommonConstant):
10381038
raise TypeError(
10391039
"operation %s argument type must be "
1040-
"CommonConstants, got %s" % (name, type(arg).__name__)
1040+
"CommonConstant, got %s" % (name, type(arg).__name__)
10411041
)
10421042

10431043
elif opcode in FORMAT_VALUE_OPS:

tests/test_instr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
INTRINSIC_2OP,
2626
SMALL_INT_OPS,
2727
SPECIAL_OPS,
28-
CommonConstants,
28+
CommonConstant,
2929
FormatValue,
3030
InstrLocation,
3131
Intrinsic1Op,
@@ -181,7 +181,7 @@ def test_invalid_arg(self):
181181
assert name == "LOAD_COMMON_CONSTANT", (
182182
f"expected LOAD_COMMON_CONSTANT but got {name=}"
183183
)
184-
Instr("LOAD_COMMON_CONSTANT", CommonConstants.BUILTIN_ALL)
184+
Instr("LOAD_COMMON_CONSTANT", CommonConstant.BUILTIN_ALL)
185185
self.assertRaises(
186186
TypeError,
187187
Instr,

0 commit comments

Comments
 (0)