Merge branch 'master' into python-3.3-to-3.5

This commit is contained in:
rocky
2023-01-14 09:43:28 -05:00
4 changed files with 20 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,18 @@
# Related to #426
# This file is RUNNABLE!
"""This program is self-checking!"""
a = 5
class MakeClosureTest():
# This function uses MAKE_CLOSURE with annotation args
def __init__(self, dev: str, b: bool):
super().__init__()
self.dev = dev
self.b = b
self.a = a
x = MakeClosureTest("dev", True)
assert x.dev == "dev"
assert x.b == True
assert x.a == 5

View File

@@ -1178,7 +1178,7 @@ class Python3Parser(PythonParser):
"pos_arg " * args_pos,
opname,
)
elif self.version == (3, 3):
elif (3, 3) <= self.version < (3, 5):
if annotate_args > 0:
rule = (
"mkfunc_annotate ::= %s%s%sannotate_tuple load_closure LOAD_CODE LOAD_STR %s"
@@ -1196,7 +1196,7 @@ class Python3Parser(PythonParser):
opname,
)
elif self.version >= (3, 4):
elif self.version >= (3, 5):
if not self.is_pypy:
load_op = "LOAD_STR"
else: