From b0544ba77cf86074fb1adde00558c67ca75eeea1 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Wed, 21 Apr 2021 12:41:19 +0100 Subject: [PATCH] bpo-38605: Revert making 'from __future__ import annotations' the default (GH-25490) This reverts commits 044a1048ca93d466965afc027b91a5a9eb9ce23c and 1be456ae9d53bb1cba2b24fc86175c282d1c2169, adapting the code to changes that happened after it. --- Doc/reference/compound_stmts.rst | 10 +- Doc/reference/simple_stmts.rst | 7 +- Doc/whatsnew/3.10.rst | 16 -- Lib/dataclasses.py | 13 +- Lib/importlib/_bootstrap_external.py | 3 +- Lib/inspect.py | 19 +- Lib/test/dataclass_module_1.py | 6 + Lib/test/dataclass_module_1_str.py | 32 +++ Lib/test/dataclass_module_2.py | 6 + Lib/test/dataclass_module_2_str.py | 32 +++ Lib/test/dataclass_textanno.py | 2 + Lib/test/test_annotations.py | 228 ------------------ Lib/test/test_coroutines.py | 8 + Lib/test/test_dataclasses.py | 77 +++--- Lib/test/test_dis.py | 36 +-- Lib/test/test_functools.py | 4 +- Lib/test/test_grammar.py | 56 +++-- Lib/test/test_inspect.py | 52 ++-- Lib/test/test_opcodes.py | 2 +- Lib/test/test_positional_only_arg.py | 17 +- Lib/test/test_pydoc.py | 4 +- Lib/test/test_syntax.py | 8 + Lib/test/test_types.py | 4 +- Lib/test/test_typing.py | 22 +- Lib/typing.py | 7 - .../2021-04-20-22-17-47.bpo-38605.9eeCNZ.rst | 5 + Python/ast_opt.c | 24 ++ Python/compile.c | 33 ++- Python/future.c | 2 +- Python/importlib_external.h | 220 ++++++++--------- Tools/peg_generator/pegen/grammar_parser.py | 2 +- Tools/peg_generator/pegen/python_generator.py | 2 +- 32 files changed, 436 insertions(+), 523 deletions(-) create mode 100644 Lib/test/dataclass_module_1_str.py create mode 100644 Lib/test/dataclass_module_2_str.py delete mode 100644 Lib/test/test_annotations.py create mode 100644 Misc/NEWS.d/next/Core and Builtins/2021-04-20-22-17-47.bpo-38605.9eeCNZ.rst diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 8e680812706..96bd9b028d5 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -1244,9 +1244,13 @@ following the parameter name. Any parameter may have an annotation, even those ``*identifier`` or ``**identifier``. Functions may have "return" annotation of the form "``-> expression``" after the parameter list. These annotations can be any valid Python expression. The presence of annotations does not change the -semantics of a function. The annotation values are available as string values -in a dictionary keyed by the parameters' names in the :attr:`__annotations__` -attribute of the function object. +semantics of a function. The annotation values are available as values of +a dictionary keyed by the parameters' names in the :attr:`__annotations__` +attribute of the function object. If the ``annotations`` import from +:mod:`__future__` is used, annotations are preserved as strings at runtime which +enables postponed evaluation. Otherwise, they are evaluated when the function +definition is executed. In this case annotations may be evaluated in +a different order than they appear in the source code. .. index:: pair: lambda; expression diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 941b3427d63..3aba2700048 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -877,11 +877,14 @@ can appear before a future statement are: * blank lines, and * other future statements. +The only feature that requires using the future statement is +``annotations`` (see :pep:`563`). + All historical features enabled by the future statement are still recognized by Python 3. The list includes ``absolute_import``, ``division``, ``generators``, ``generator_stop``, ``unicode_literals``, -``print_function``, ``nested_scopes``, ``with_statement`` and ``annotations``. -They are all redundant because they are always enabled, and only kept for +``print_function``, ``nested_scopes`` and ``with_statement``. They are +all redundant because they are always enabled, and only kept for backwards compatibility. A future statement is recognized and treated specially at compile time: Changes diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 523668c7653..9ae9fe8d2d9 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -624,22 +624,6 @@ This section covers major changes affecting :pep:`484` type annotations and the :mod:`typing` module. -PEP 563: Postponed Evaluation of Annotations Becomes Default ------------------------------------------------------------- - -In Python 3.7, postponed evaluation of annotations was added, -to be enabled with a ``from __future__ import annotations`` -directive. In 3.10 this became the default behavior, even -without that future directive. With this being default, all -annotations stored in :attr:`__annotations__` will be strings. -If needed, annotations can be resolved at runtime using -:func:`typing.get_type_hints`. See :pep:`563` for a full -description. Also, the :func:`inspect.signature` will try to -resolve types from now on, and when it fails it will fall back to -showing the string annotations. (Contributed by Batuhan Taskaya -in :issue:`38605`.) - - PEP 604: New Type Union Operator -------------------------------- diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index 1b95bb961d9..036349bfbda 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -413,10 +413,8 @@ def _create_fn(name, args, body, *, globals=None, locals=None, ns = {} exec(txt, globals, ns) - func = ns['__create_fn__'](**locals) - for arg, annotation in func.__annotations__.copy().items(): - func.__annotations__[arg] = locals[annotation] - return func + return ns['__create_fn__'](**locals) + def _field_assign(frozen, name, value, self_name): # If we're a frozen class, then assign to our fields in __init__ @@ -667,11 +665,6 @@ def _is_type(annotation, cls, a_module, a_type, is_type_predicate): # a eval() penalty for every single field of every dataclass # that's defined. It was judged not worth it. - # Strip away the extra quotes as a result of double-stringifying when the - # 'annotations' feature became default. - if annotation.startswith(("'", '"')) and annotation.endswith(("'", '"')): - annotation = annotation[1:-1] - match = _MODULE_IDENTIFIER_RE.match(annotation) if match: ns = None @@ -1020,7 +1013,7 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen, if not getattr(cls, '__doc__'): # Create a class doc-string. cls.__doc__ = (cls.__name__ + - str(inspect.signature(cls)).replace(' -> NoneType', '')) + str(inspect.signature(cls)).replace(' -> None', '')) if match_args: _set_new_attribute(cls, '__match_args__', diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 66ba7dceedc..6620b241fcf 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -349,6 +349,7 @@ _code_type = type(_write_atomic.__code__) # Python 3.10a6 3434 (PEP 634: Structural Pattern Matching) # Python 3.10a7 3435 Use instruction offsets (as opposed to byte offsets). # Python 3.10b1 3436 (Add GEN_START bytecode #43683) +# Python 3.10b1 3437 (Undo making 'annotations' future by default - We like to dance among core devs!) # # MAGIC must change whenever the bytecode emitted by the compiler may no @@ -358,7 +359,7 @@ _code_type = type(_write_atomic.__code__) # Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array # in PC/launcher.c must also be updated. -MAGIC_NUMBER = (3436).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3437).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c _PYCACHE = '__pycache__' diff --git a/Lib/inspect.py b/Lib/inspect.py index d6d2ce64617..b8e247ec252 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -45,7 +45,6 @@ import sys import tokenize import token import types -import typing import warnings import functools import builtins @@ -1893,10 +1892,7 @@ def _signature_is_functionlike(obj): code = getattr(obj, '__code__', None) defaults = getattr(obj, '__defaults__', _void) # Important to use _void ... kwdefaults = getattr(obj, '__kwdefaults__', _void) # ... and not None here - try: - annotations = _get_type_hints(obj) - except AttributeError: - annotations = None + annotations = getattr(obj, '__annotations__', None) return (isinstance(code, types.CodeType) and isinstance(name, str) and @@ -2137,16 +2133,6 @@ def _signature_fromstr(cls, obj, s, skip_bound_arg=True): return cls(parameters, return_annotation=cls.empty) -def _get_type_hints(func, **kwargs): - try: - return typing.get_type_hints(func, **kwargs) - except Exception: - # First, try to use the get_type_hints to resolve - # annotations. But for keeping the behavior intact - # if there was a problem with that (like the namespace - # can't resolve some annotation) continue to use - # string annotations - return func.__annotations__ def _signature_from_builtin(cls, func, skip_bound_arg=True): """Private helper function to get signature for @@ -2191,8 +2177,7 @@ def _signature_from_function(cls, func, skip_bound_arg=True, positional = arg_names[:pos_count] keyword_only_count = func_code.co_kwonlyargcount keyword_only = arg_names[pos_count:pos_count + keyword_only_count] - annotations = _get_type_hints(func, globalns=globalns, localns=localns) - + annotations = func.__annotations__ defaults = func.__defaults__ kwdefaults = func.__kwdefaults__ diff --git a/Lib/test/dataclass_module_1.py b/Lib/test/dataclass_module_1.py index 9f0aeda67f9..87a33f8191d 100644 --- a/Lib/test/dataclass_module_1.py +++ b/Lib/test/dataclass_module_1.py @@ -1,3 +1,9 @@ +#from __future__ import annotations +USING_STRINGS = False + +# dataclass_module_1.py and dataclass_module_1_str.py are identical +# except only the latter uses string annotations. + import dataclasses import typing diff --git a/Lib/test/dataclass_module_1_str.py b/Lib/test/dataclass_module_1_str.py new file mode 100644 index 00000000000..6de490b7ad7 --- /dev/null +++ b/Lib/test/dataclass_module_1_str.py @@ -0,0 +1,32 @@ +from __future__ import annotations +USING_STRINGS = True + +# dataclass_module_1.py and dataclass_module_1_str.py are identical +# except only the latter uses string annotations. + +import dataclasses +import typing + +T_CV2 = typing.ClassVar[int] +T_CV3 = typing.ClassVar + +T_IV2 = dataclasses.InitVar[int] +T_IV3 = dataclasses.InitVar + +@dataclasses.dataclass +class CV: + T_CV4 = typing.ClassVar + cv0: typing.ClassVar[int] = 20 + cv1: typing.ClassVar = 30 + cv2: T_CV2 + cv3: T_CV3 + not_cv4: T_CV4 # When using string annotations, this field is not recognized as a ClassVar. + +@dataclasses.dataclass +class IV: + T_IV4 = dataclasses.InitVar + iv0: dataclasses.InitVar[int] + iv1: dataclasses.InitVar + iv2: T_IV2 + iv3: T_IV3 + not_iv4: T_IV4 # When using string annotations, this field is not recognized as an InitVar. diff --git a/Lib/test/dataclass_module_2.py b/Lib/test/dataclass_module_2.py index 8d120d181bd..68fb733e299 100644 --- a/Lib/test/dataclass_module_2.py +++ b/Lib/test/dataclass_module_2.py @@ -1,3 +1,9 @@ +#from __future__ import annotations +USING_STRINGS = False + +# dataclass_module_2.py and dataclass_module_2_str.py are identical +# except only the latter uses string annotations. + from dataclasses import dataclass, InitVar from typing import ClassVar diff --git a/Lib/test/dataclass_module_2_str.py b/Lib/test/dataclass_module_2_str.py new file mode 100644 index 00000000000..b363d17c176 --- /dev/null +++ b/Lib/test/dataclass_module_2_str.py @@ -0,0 +1,32 @@ +from __future__ import annotations +USING_STRINGS = True + +# dataclass_module_2.py and dataclass_module_2_str.py are identical +# except only the latter uses string annotations. + +from dataclasses import dataclass, InitVar +from typing import ClassVar + +T_CV2 = ClassVar[int] +T_CV3 = ClassVar + +T_IV2 = InitVar[int] +T_IV3 = InitVar + +@dataclass +class CV: + T_CV4 = ClassVar + cv0: ClassVar[int] = 20 + cv1: ClassVar = 30 + cv2: T_CV2 + cv3: T_CV3 + not_cv4: T_CV4 # When using string annotations, this field is not recognized as a ClassVar. + +@dataclass +class IV: + T_IV4 = InitVar + iv0: InitVar[int] + iv1: InitVar + iv2: T_IV2 + iv3: T_IV3 + not_iv4: T_IV4 # When using string annotations, this field is not recognized as an InitVar. diff --git a/Lib/test/dataclass_textanno.py b/Lib/test/dataclass_textanno.py index 589b60f0cd6..3eb6c943d4c 100644 --- a/Lib/test/dataclass_textanno.py +++ b/Lib/test/dataclass_textanno.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import dataclasses diff --git a/Lib/test/test_annotations.py b/Lib/test/test_annotations.py deleted file mode 100644 index 3e6b709fb4f..00000000000 --- a/Lib/test/test_annotations.py +++ /dev/null @@ -1,228 +0,0 @@ -import unittest -import sys -from textwrap import dedent - -class PostponedAnnotationsTestCase(unittest.TestCase): - template = dedent( - """ - def f() -> {ann}: - ... - def g(arg: {ann}) -> None: - ... - async def f2() -> {ann}: - ... - async def g2(arg: {ann}) -> None: - ... - var: {ann} - var2: {ann} = None - """ - ) - - def getActual(self, annotation): - scope = {} - exec(self.template.format(ann=annotation), {}, scope) - func_ret_ann = scope['f'].__annotations__['return'] - func_arg_ann = scope['g'].__annotations__['arg'] - async_func_ret_ann = scope['f2'].__annotations__['return'] - async_func_arg_ann = scope['g2'].__annotations__['arg'] - var_ann1 = scope['__annotations__']['var'] - var_ann2 = scope['__annotations__']['var2'] - self.assertEqual(func_ret_ann, func_arg_ann) - self.assertEqual(func_ret_ann, async_func_ret_ann) - self.assertEqual(func_ret_ann, async_func_arg_ann) - self.assertEqual(func_ret_ann, var_ann1) - self.assertEqual(func_ret_ann, var_ann2) - return func_ret_ann - - def assertAnnotationEqual( - self, annotation, expected=None, drop_parens=False, is_tuple=False, - ): - actual = self.getActual(annotation) - if expected is None: - expected = annotation if not is_tuple else annotation[1:-1] - if drop_parens: - self.assertNotEqual(actual, expected) - actual = actual.replace("(", "").replace(")", "") - - self.assertEqual(actual, expected) - - def test_annotations(self): - eq = self.assertAnnotationEqual - eq('...') - eq("'some_string'") - eq("u'some_string'") - eq("b'\\xa3'") - eq('Name') - eq('None') - eq('True') - eq('False') - eq('1') - eq('1.0') - eq('1j') - eq('True or False') - eq('True or False or None') - eq('True and False') - eq('True and False and None') - eq('Name1 and Name2 or Name3') - eq('Name1 and (Name2 or Name3)') - eq('Name1 or Name2 and Name3') - eq('(Name1 or Name2) and Name3') - eq('Name1 and Name2 or Name3 and Name4') - eq('Name1 or Name2 and Name3 or Name4') - eq('a + b + (c + d)') - eq('a * b * (c * d)') - eq('(a ** b) ** c ** d') - eq('v1 << 2') - eq('1 >> v2') - eq('1 % finished') - eq('1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8') - eq('not great') - eq('not not great') - eq('~great') - eq('+value') - eq('++value') - eq('-1') - eq('~int and not v1 ^ 123 + v2 | True') - eq('a + (not b)') - eq('lambda: None') - eq('lambda arg: None') - eq('lambda a=True: a') - eq('lambda a, b, c=True: a') - eq("lambda a, b, c=True, *, d=1 << v2, e='str': a") - eq("lambda a, b, c=True, *vararg, d, e='str', **kwargs: a + b") - eq("lambda a, /, b, c=True, *vararg, d, e='str', **kwargs: a + b") - eq('lambda x, /: x') - eq('lambda x=1, /: x') - eq('lambda x, /, y: x + y') - eq('lambda x=1, /, y=2: x + y') - eq('lambda x, /, y=1: x + y') - eq('lambda x, /, y=1, *, z=3: x + y + z') - eq('lambda x=1, /, y=2, *, z=3: x + y + z') - eq('lambda x=1, /, y=2, *, z: x + y + z') - eq('lambda x=1, y=2, z=3, /, w=4, *, l, l2: x + y + z + w + l + l2') - eq('lambda x=1, y=2, z=3, /, w=4, *, l, l2, **kwargs: x + y + z + w + l + l2') - eq('lambda x, /, y=1, *, z: x + y + z') - eq('lambda x: lambda y: x + y') - eq('1 if True else 2') - eq('str or None if int or True else str or bytes or None') - eq('str or None if (1 if True else 2) else str or bytes or None') - eq("0 if not x else 1 if x > 0 else -1") - eq("(1 if x > 0 else -1) if x else 0") - eq("{'2.7': dead, '3.7': long_live or die_hard}") - eq("{'2.7': dead, '3.7': long_live or die_hard, **{'3.6': verygood}}") - eq("{**a, **b, **c}") - eq("{'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}") - eq("{*a, *b, *c}") - eq("({'a': 'b'}, True or False, +value, 'string', b'bytes') or None") - eq("()") - eq("(a,)") - eq("(a, b)") - eq("(a, b, c)") - eq("(*a, *b, *c)") - eq("[]") - eq("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]") - eq("[*a, *b, *c]") - eq("{i for i in (1, 2, 3)}") - eq("{i ** 2 for i in (1, 2, 3)}") - eq("{i ** 2 for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}") - eq("{i ** 2 + j for i in (1, 2, 3) for j in (1, 2, 3)}") - eq("[i for i in (1, 2, 3)]") - eq("[i ** 2 for i in (1, 2, 3)]") - eq("[i ** 2 for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]") - eq("[i ** 2 + j for i in (1, 2, 3) for j in (1, 2, 3)]") - eq("(i for i in (1, 2, 3))") - eq("(i ** 2 for i in (1, 2, 3))") - eq("(i ** 2 for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))") - eq("(i ** 2 + j for i in (1, 2, 3) for j in (1, 2, 3))") - eq("{i: 0 for i in (1, 2, 3)}") - eq("{i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}") - eq("[(x, y) for x, y in (a, b)]") - eq("[(x,) for x, in (a,)]") - eq("Python3 > Python2 > COBOL") - eq("Life is Life") - eq("call()") - eq("call(arg)") - eq("call(kwarg='hey')") - eq("call(arg, kwarg='hey')") - eq("call(arg, *args, another, kwarg='hey')") - eq("call(arg, another, kwarg='hey', **kwargs, kwarg2='ho')") - eq("lukasz.langa.pl") - eq("call.me(maybe)") - eq("1 .real") - eq("1.0.real") - eq("....__class__") - eq("list[str]") - eq("dict[str, int]") - eq("set[str,]") - eq("tuple[str, ...]") - eq("tuple[(str, *types)]") - eq("tuple[str, int, (str, int)]") - eq("tuple[(*int, str, str, (str, int))]") - eq("tuple[str, int, float, dict[str, int]]") - eq("slice[0]") - eq("slice[0:1]") - eq("slice[0:1:2]") - eq("slice[:]") - eq("slice[:-1]") - eq("slice[1:]") - eq("slice[::-1]") - eq("slice[:,]") - eq("slice[1:2,]") - eq("slice[1:2:3,]") - eq("slice[1:2, 1]") - eq("slice[1:2, 2, 3]") - eq("slice[()]") - eq("slice[a, b:c, d:e:f]") - eq("slice[(x for x in a)]") - eq('str or None if sys.version_info[0] > (3,) else str or bytes or None') - eq("f'f-string without formatted values is just a string'") - eq("f'{{NOT a formatted value}}'") - eq("f'some f-string with {a} {few():.2f} {formatted.values!r}'") - eq('''f"{f'{nested} inner'} outer"''') - eq("f'space between opening braces: { {a for a in (1, 2, 3)}}'") - eq("f'{(lambda x: x)}'") - eq("f'{(None if a else lambda x: x)}'") - eq("f'{x}'") - eq("f'{x!r}'") - eq("f'{x!a}'") - eq('(yield from outside_of_generator)') - eq('(yield)') - eq('(yield a + b)') - eq('await some.complicated[0].call(with_args=True or 1 is not 1)') - eq('[x for x in (a if b else c)]') - eq('[x for x in a if (b if c else d)]') - eq('f(x for x in a)') - eq('f(1, (x for x in a))') - eq('f((x for x in a), 2)') - eq('(((a)))', 'a') - eq('(((a, b)))', '(a, b)') - eq("(x := 10)") - eq("f'{(x := 10):=10}'") - eq("1 + 2") - eq("1 + 2 + 3") - - def test_fstring_debug_annotations(self): - # f-strings with '=' don't round trip very well, so set the expected - # result explicitely. - self.assertAnnotationEqual("f'{x=!r}'", expected="f'x={x!r}'") - self.assertAnnotationEqual("f'{x=:}'", expected="f'x={x:}'") - self.assertAnnotationEqual("f'{x=:.2f}'", expected="f'x={x:.2f}'") - self.assertAnnotationEqual("f'{x=!r}'", expected="f'x={x!r}'") - self.assertAnnotationEqual("f'{x=!a}'", expected="f'x={x!a}'") - self.assertAnnotationEqual("f'{x=!s:*^20}'", expected="f'x={x!s:*^20}'") - - def test_infinity_numbers(self): - inf = "1e" + repr(sys.float_info.max_10_exp + 1) - infj = f"{inf}j" - self.assertAnnotationEqual("1e1000", expected=inf) - self.assertAnnotationEqual("1e1000j", expected=infj) - self.assertAnnotationEqual("-1e1000", expected=f"-{inf}") - self.assertAnnotationEqual("3+1e1000j", expected=f"3 + {infj}") - self.assertAnnotationEqual("(1e1000, 1e1000j)", expected=f"({inf}, {infj})") - self.assertAnnotationEqual("'inf'") - self.assertAnnotationEqual("('inf', 1e1000, 'infxxx', 1e1000j)", expected=f"('inf', {inf}, 'infxxx', {infj})") - self.assertAnnotationEqual("(1e1000, (1e1000j,))", expected=f"({inf}, ({infj},))") - - -if __name__ == "__main__": - unittest.main() diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 40c2eb8d232..145adb67781 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -91,6 +91,10 @@ class AsyncBadSyntaxTest(unittest.TestCase): pass """, + """async def foo(a:await something()): + pass + """, + """async def foo(): def bar(): [i async for i in els] @@ -295,6 +299,10 @@ class AsyncBadSyntaxTest(unittest.TestCase): pass """, + """async def foo(a:await b): + pass + """, + """def baz(): async def foo(a=await b): pass diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py index 4beed69e45b..f35f466125d 100644 --- a/Lib/test/test_dataclasses.py +++ b/Lib/test/test_dataclasses.py @@ -9,7 +9,6 @@ import pickle import inspect import builtins import unittest -from textwrap import dedent from unittest.mock import Mock from typing import ClassVar, Any, List, Union, Tuple, Dict, Generic, TypeVar, Optional from typing import get_type_hints @@ -563,17 +562,17 @@ class TestCase(unittest.TestCase): self.assertEqual(len(the_fields), 3) self.assertEqual(the_fields[0].name, 'x') - self.assertEqual(the_fields[0].type, 'int') + self.assertEqual(the_fields[0].type, int) self.assertFalse(hasattr(C, 'x')) self.assertTrue (the_fields[0].init) self.assertTrue (the_fields[0].repr) self.assertEqual(the_fields[1].name, 'y') - self.assertEqual(the_fields[1].type, 'str') + self.assertEqual(the_fields[1].type, str) self.assertIsNone(getattr(C, 'y')) self.assertFalse(the_fields[1].init) self.assertTrue (the_fields[1].repr) self.assertEqual(the_fields[2].name, 'z') - self.assertEqual(the_fields[2].type, 'str') + self.assertEqual(the_fields[2].type, str) self.assertFalse(hasattr(C, 'z')) self.assertTrue (the_fields[2].init) self.assertFalse(the_fields[2].repr) @@ -759,11 +758,11 @@ class TestCase(unittest.TestCase): def validate_class(cls): # First, check __annotations__, even though they're not # function annotations. - self.assertEqual(cls.__annotations__['i'], 'int') - self.assertEqual(cls.__annotations__['j'], 'str') - self.assertEqual(cls.__annotations__['k'], 'F') - self.assertEqual(cls.__annotations__['l'], 'float') - self.assertEqual(cls.__annotations__['z'], 'complex') + self.assertEqual(cls.__annotations__['i'], int) + self.assertEqual(cls.__annotations__['j'], str) + self.assertEqual(cls.__annotations__['k'], F) + self.assertEqual(cls.__annotations__['l'], float) + self.assertEqual(cls.__annotations__['z'], complex) # Verify __init__. @@ -778,22 +777,22 @@ class TestCase(unittest.TestCase): self.assertEqual(param.name, 'self') param = next(params) self.assertEqual(param.name, 'i') - self.assertIs (param.annotation, 'int') + self.assertIs (param.annotation, int) self.assertEqual(param.default, inspect.Parameter.empty) self.assertEqual(param.kind, inspect.Parameter.POSITIONAL_OR_KEYWORD) param = next(params) self.assertEqual(param.name, 'j') - self.assertIs (param.annotation, 'str') + self.assertIs (param.annotation, str) self.assertEqual(param.default, inspect.Parameter.empty) self.assertEqual(param.kind, inspect.Parameter.POSITIONAL_OR_KEYWORD) param = next(params) self.assertEqual(param.name, 'k') - self.assertIs (param.annotation, 'F') + self.assertIs (param.annotation, F) # Don't test for the default, since it's set to MISSING. self.assertEqual(param.kind, inspect.Parameter.POSITIONAL_OR_KEYWORD) param = next(params) self.assertEqual(param.name, 'l') - self.assertIs (param.annotation, 'float') + self.assertIs (param.annotation, float) # Don't test for the default, since it's set to MISSING. self.assertEqual(param.kind, inspect.Parameter.POSITIONAL_OR_KEYWORD) self.assertRaises(StopIteration, next, params) @@ -2855,6 +2854,9 @@ class TestDescriptors(unittest.TestCase): class TestStringAnnotations(unittest.TestCase): def test_classvar(self): + # Some expressions recognized as ClassVar really aren't. But + # if you're using string annotations, it's not an exact + # science. # These tests assume that both "import typing" and "from # typing import *" have been run in this file. for typestr in ('ClassVar[int]', @@ -2869,15 +2871,17 @@ class TestStringAnnotations(unittest.TestCase): 'typing. ClassVar[str]', 'typing.ClassVar [str]', 'typing.ClassVar [ str]', - # Double stringified - '"typing.ClassVar[int]"', + # Not syntactically valid, but these will - # be treated as ClassVars. + # be treated as ClassVars. 'typing.ClassVar.[int]', 'typing.ClassVar+', ): with self.subTest(typestr=typestr): - C = dataclass(type("C", (), {"__annotations__": {"x": typestr}})) + @dataclass + class C: + x: typestr + # x is a ClassVar, so C() takes no args. C() @@ -2898,7 +2902,9 @@ class TestStringAnnotations(unittest.TestCase): 'typingxClassVar[str]', ): with self.subTest(typestr=typestr): - C = dataclass(type("C", (), {"__annotations__": {"x": typestr}})) + @dataclass + class C: + x: typestr # x is not a ClassVar, so C() takes one arg. self.assertEqual(C(10).x, 10) @@ -2918,16 +2924,16 @@ class TestStringAnnotations(unittest.TestCase): 'dataclasses. InitVar[str]', 'dataclasses.InitVar [str]', 'dataclasses.InitVar [ str]', - # Double stringified - '"dataclasses.InitVar[int]"', + # Not syntactically valid, but these will # be treated as InitVars. 'dataclasses.InitVar.[int]', 'dataclasses.InitVar+', ): with self.subTest(typestr=typestr): - C = dataclass(type("C", (), {"__annotations__": {"x": typestr}})) - + @dataclass + class C: + x: typestr # x is an InitVar, so doesn't create a member. with self.assertRaisesRegex(AttributeError, @@ -2941,22 +2947,30 @@ class TestStringAnnotations(unittest.TestCase): 'typing.xInitVar[int]', ): with self.subTest(typestr=typestr): - C = dataclass(type("C", (), {"__annotations__": {"x": typestr}})) + @dataclass + class C: + x: typestr # x is not an InitVar, so there will be a member x. self.assertEqual(C(10).x, 10) def test_classvar_module_level_import(self): from test import dataclass_module_1 + from test import dataclass_module_1_str from test import dataclass_module_2 + from test import dataclass_module_2_str - for m in (dataclass_module_1, - dataclass_module_2): + for m in (dataclass_module_1, dataclass_module_1_str, + dataclass_module_2, dataclass_module_2_str, + ): with self.subTest(m=m): # There's a difference in how the ClassVars are # interpreted when using string annotations or # not. See the imported modules for details. - c = m.CV(10) + if m.USING_STRINGS: + c = m.CV(10) + else: + c = m.CV() self.assertEqual(c.cv0, 20) @@ -2972,9 +2986,14 @@ class TestStringAnnotations(unittest.TestCase): # not an instance field. getattr(c, field_name) - # iv4 is interpreted as a normal field. - self.assertIn('not_iv4', c.__dict__) - self.assertEqual(c.not_iv4, 4) + if m.USING_STRINGS: + # iv4 is interpreted as a normal field. + self.assertIn('not_iv4', c.__dict__) + self.assertEqual(c.not_iv4, 4) + else: + # iv4 is interpreted as an InitVar, so it + # won't exist on the instance. + self.assertNotIn('not_iv4', c.__dict__) def test_text_annotations(self): from test import dataclass_textanno diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index 19e5c0f6335..8e36ae266b9 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -237,26 +237,28 @@ dis_annot_stmt_str = """\ 2 0 SETUP_ANNOTATIONS 2 LOAD_CONST 0 (1) 4 STORE_NAME 0 (x) - 6 LOAD_CONST 1 ('int') - 8 LOAD_NAME 1 (__annotations__) - 10 LOAD_CONST 2 ('x') + 6 LOAD_NAME 1 (int) + 8 LOAD_NAME 2 (__annotations__) + 10 LOAD_CONST 1 ('x') 12 STORE_SUBSCR - 3 14 LOAD_CONST 3 ('fun(1)') - 16 LOAD_NAME 1 (__annotations__) - 18 LOAD_CONST 4 ('y') - 20 STORE_SUBSCR + 3 14 LOAD_NAME 3 (fun) + 16 LOAD_CONST 0 (1) + 18 CALL_FUNCTION 1 + 20 LOAD_NAME 2 (__annotations__) + 22 LOAD_CONST 2 ('y') + 24 STORE_SUBSCR - 4 22 LOAD_CONST 0 (1) - 24 LOAD_NAME 2 (lst) - 26 LOAD_NAME 3 (fun) - 28 LOAD_CONST 5 (0) - 30 CALL_FUNCTION 1 - 32 STORE_SUBSCR - 34 LOAD_NAME 4 (int) - 36 POP_TOP - 38 LOAD_CONST 6 (None) - 40 RETURN_VALUE + 4 26 LOAD_CONST 0 (1) + 28 LOAD_NAME 4 (lst) + 30 LOAD_NAME 3 (fun) + 32 LOAD_CONST 3 (0) + 34 CALL_FUNCTION 1 + 36 STORE_SUBSCR + 38 LOAD_NAME 1 (int) + 40 POP_TOP + 42 LOAD_CONST 4 (None) + 44 RETURN_VALUE """ compound_stmt_str = """\ diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index caeeb2712a1..fba9281deb3 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -617,7 +617,7 @@ class TestUpdateWrapper(unittest.TestCase): def _default_update(self): - def f(a: int): + def f(a:'This is a new annotation'): """This is a test""" pass f.attr = 'This is also a test' @@ -634,7 +634,7 @@ class TestUpdateWrapper(unittest.TestCase): self.assertEqual(wrapper.__name__, 'f') self.assertEqual(wrapper.__qualname__, f.__qualname__) self.assertEqual(wrapper.attr, 'This is also a test') - self.assertEqual(wrapper.__annotations__['a'], 'int') + self.assertEqual(wrapper.__annotations__['a'], 'This is a new annotation') self.assertNotIn('b', wrapper.__annotations__) @unittest.skipIf(sys.flags.optimize >= 2, diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index c15f10b8bc7..6f79e19a544 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -363,7 +363,7 @@ class GrammarTests(unittest.TestCase): z = 2 def __init__(self, x): self.x: int = x - self.assertEqual(C.__annotations__, {'_C__foo': 'int', 's': 'str'}) + self.assertEqual(C.__annotations__, {'_C__foo': int, 's': str}) with self.assertRaises(NameError): class CBad: no_such_name_defined.attr: int = 0 @@ -379,15 +379,15 @@ class GrammarTests(unittest.TestCase): return {'__annotations__': CNS()} class CC(metaclass=CMeta): XX: 'ANNOT' - self.assertEqual(CC.__annotations__['xx'], repr('ANNOT')) + self.assertEqual(CC.__annotations__['xx'], 'ANNOT') def test_var_annot_module_semantics(self): with self.assertRaises(AttributeError): print(test.__annotations__) self.assertEqual(ann_module.__annotations__, - {1: 2, 'x': 'int', 'y': 'str', 'f': 'Tuple[int, int]'}) + {1: 2, 'x': int, 'y': str, 'f': typing.Tuple[int, int]}) self.assertEqual(ann_module.M.__annotations__, - {'123': 123, 'o': 'type'}) + {'123': 123, 'o': type}) self.assertEqual(ann_module2.__annotations__, {}) def test_var_annot_in_module(self): @@ -406,7 +406,7 @@ class GrammarTests(unittest.TestCase): exec("'docstring'\n" "__annotations__[1] = 2\n" "x: int = 5\n", gns, lns) - self.assertEqual(lns["__annotations__"], {1: 2, 'x': 'int'}) + self.assertEqual(lns["__annotations__"], {1: 2, 'x': int}) with self.assertRaises(KeyError): gns['__annotations__'] @@ -414,8 +414,8 @@ class GrammarTests(unittest.TestCase): # tests with custom locals() and __annotations__ ns = {'__annotations__': CNS()} exec('X: int; Z: str = "Z"; (w): complex = 1j', ns) - self.assertEqual(ns['__annotations__']['x'], 'int') - self.assertEqual(ns['__annotations__']['z'], 'str') + self.assertEqual(ns['__annotations__']['x'], int) + self.assertEqual(ns['__annotations__']['z'], str) with self.assertRaises(KeyError): ns['__annotations__']['w'] nonloc_ns = {} @@ -429,7 +429,7 @@ class GrammarTests(unittest.TestCase): def __getitem__(self, item): return self._dct[item] exec('x: int = 1', {}, CNS2()) - self.assertEqual(nonloc_ns['__annotations__']['x'], 'int') + self.assertEqual(nonloc_ns['__annotations__']['x'], int) def test_var_annot_refleak(self): # complex case: custom locals plus custom __annotations__ @@ -446,7 +446,7 @@ class GrammarTests(unittest.TestCase): def __getitem__(self, item): return self._dct[item] exec('X: str', {}, CNS2()) - self.assertEqual(nonloc_ns['__annotations__']['x'], 'str') + self.assertEqual(nonloc_ns['__annotations__']['x'], str) def test_var_annot_rhs(self): ns = {} @@ -626,46 +626,50 @@ class GrammarTests(unittest.TestCase): # argument annotation tests def f(x) -> list: pass - self.assertEqual(f.__annotations__, {'return': 'list'}) + self.assertEqual(f.__annotations__, {'return': list}) def f(x: int): pass - self.assertEqual(f.__annotations__, {'x': 'int'}) + self.assertEqual(f.__annotations__, {'x': int}) def f(x: int, /): pass - self.assertEqual(f.__annotations__, {'x': 'int'}) + self.assertEqual(f.__annotations__, {'x': int}) def f(x: int = 34, /): pass - self.assertEqual(f.__annotations__, {'x': 'int'}) + self.assertEqual(f.__annotations__, {'x': int}) def f(*x: str): pass - self.assertEqual(f.__annotations__, {'x': 'str'}) + self.assertEqual(f.__annotations__, {'x': str}) def f(**x: float): pass - self.assertEqual(f.__annotations__, {'x': 'float'}) + self.assertEqual(f.__annotations__, {'x': float}) + def f(x, y: 1+2): pass + self.assertEqual(f.__annotations__, {'y': 3}) + def f(x, y: 1+2, /): pass + self.assertEqual(f.__annotations__, {'y': 3}) def f(a, b: 1, c: 2, d): pass - self.assertEqual(f.__annotations__, {'b': '1', 'c': '2'}) + self.assertEqual(f.__annotations__, {'b': 1, 'c': 2}) def f(a, b: 1, /, c: 2, d): pass - self.assertEqual(f.__annotations__, {'b': '1', 'c': '2'}) + self.assertEqual(f.__annotations__, {'b': 1, 'c': 2}) def f(a, b: 1, c: 2, d, e: 3 = 4, f=5, *g: 6): pass self.assertEqual(f.__annotations__, - {'b': '1', 'c': '2', 'e': '3', 'g': '6'}) + {'b': 1, 'c': 2, 'e': 3, 'g': 6}) def f(a, b: 1, c: 2, d, e: 3 = 4, f=5, *g: 6, h: 7, i=8, j: 9 = 10, **k: 11) -> 12: pass self.assertEqual(f.__annotations__, - {'b': '1', 'c': '2', 'e': '3', 'g': '6', 'h': '7', 'j': '9', - 'k': '11', 'return': '12'}) + {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9, + 'k': 11, 'return': 12}) def f(a, b: 1, c: 2, d, e: 3 = 4, f: int = 5, /, *g: 6, h: 7, i=8, j: 9 = 10, **k: 11) -> 12: pass self.assertEqual(f.__annotations__, - {'b': '1', 'c': '2', 'e': '3', 'f': 'int', 'g': '6', 'h': '7', 'j': '9', - 'k': '11', 'return': '12'}) + {'b': 1, 'c': 2, 'e': 3, 'f': int, 'g': 6, 'h': 7, 'j': 9, + 'k': 11, 'return': 12}) # Check for issue #20625 -- annotations mangling class Spam: def f(self, *, __kw: 1): pass class Ham(Spam): pass - self.assertEqual(Spam.f.__annotations__, {'_Spam__kw': '1'}) - self.assertEqual(Ham.f.__annotations__, {'_Spam__kw': '1'}) + self.assertEqual(Spam.f.__annotations__, {'_Spam__kw': 1}) + self.assertEqual(Ham.f.__annotations__, {'_Spam__kw': 1}) # Check for SF Bug #1697248 - mixing decorators and a return annotation def null(x): return x @null def f(x) -> list: pass - self.assertEqual(f.__annotations__, {'return': 'list'}) + self.assertEqual(f.__annotations__, {'return': list}) # Test expressions as decorators (PEP 614): @False or null @@ -1113,6 +1117,8 @@ class GrammarTests(unittest.TestCase): # Not allowed at class scope check_syntax_error(self, "class foo:yield 1") check_syntax_error(self, "class foo:yield from ()") + # Check annotation refleak on SyntaxError + check_syntax_error(self, "def g(a:(yield)): pass") def test_yield_in_comprehensions(self): # Check yield in comprehensions diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 35ad0b93e7d..b32b3d37577 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -888,7 +888,7 @@ class TestClassesAndFunctions(unittest.TestCase): self.assertFullArgSpecEquals(mod2.annotated, ['arg1'], ann_e={'arg1' : list}, - formatted="(arg1: list)") + formatted='(arg1: list)') self.assertFullArgSpecEquals(mod2.keyword_only_arg, [], kwonlyargs_e=['arg'], formatted='(*, arg)') @@ -2237,8 +2237,8 @@ class TestSignatureObject(unittest.TestCase): pass self.assertEqual(self.signature(test), ((('a', ..., ..., "positional_or_keyword"), - ('b', ..., repr('foo'), "positional_or_keyword")), - '123')) + ('b', ..., 'foo', "positional_or_keyword")), + 123)) def test_signature_on_wkwonly(self): def test(*, a:float, b:str) -> int: @@ -2253,11 +2253,11 @@ class TestSignatureObject(unittest.TestCase): pass self.assertEqual(self.signature(test), ((('a', ..., ..., "positional_or_keyword"), - ('b', 10, repr('foo'), "positional_or_keyword"), - ('args', ..., repr('bar'), "var_positional"), - ('spam', ..., repr('baz'), "keyword_only"), + ('b', 10, 'foo', "positional_or_keyword"), + ('args', ..., 'bar', "var_positional"), + ('spam', ..., 'baz', "keyword_only"), ('ham', 123, ..., "keyword_only"), - ('kwargs', ..., 'int', "var_keyword")), + ('kwargs', ..., int, "var_keyword")), ...)) def test_signature_without_self(self): @@ -2666,12 +2666,12 @@ class TestSignatureObject(unittest.TestCase): self.assertEqual(self.signature(partial(partial(test, 1))), ((('b', ..., ..., "positional_or_keyword"), - ('c', ..., 'int', "positional_or_keyword")), - '42')) + ('c', ..., int, "positional_or_keyword")), + 42)) self.assertEqual(self.signature(partial(partial(test, 1), 2)), - ((('c', ..., 'int', "positional_or_keyword"),), - '42')) + ((('c', ..., int, "positional_or_keyword"),), + 42)) psig = inspect.signature(partial(partial(test, 1), 2)) @@ -2790,12 +2790,12 @@ class TestSignatureObject(unittest.TestCase): ((('it', ..., ..., 'positional_or_keyword'), ('a', ..., ..., 'positional_or_keyword'), ('c', 1, ..., 'keyword_only')), - repr('spam'))) + 'spam')) self.assertEqual(self.signature(Spam().ham), ((('a', ..., ..., 'positional_or_keyword'), ('c', 1, ..., 'keyword_only')), - repr('spam'))) + 'spam')) class Spam: def test(self: 'anno', x): @@ -2804,7 +2804,7 @@ class TestSignatureObject(unittest.TestCase): g = partialmethod(test, 1) self.assertEqual(self.signature(Spam.g), - ((('self', ..., repr('anno'), 'positional_or_keyword'),), + ((('self', ..., 'anno', 'positional_or_keyword'),), ...)) def test_signature_on_fake_partialmethod(self): @@ -3142,16 +3142,20 @@ class TestSignatureObject(unittest.TestCase): with self.assertRaisesRegex(TypeError, 'unhashable type'): hash(inspect.signature(foo)) + def foo(a) -> {}: pass + with self.assertRaisesRegex(TypeError, 'unhashable type'): + hash(inspect.signature(foo)) + def test_signature_str(self): def foo(a:int=1, *, b, c=None, **kwargs) -> 42: pass self.assertEqual(str(inspect.signature(foo)), - '(a: \'int\' = 1, *, b, c=None, **kwargs) -> \'42\'') + '(a: int = 1, *, b, c=None, **kwargs) -> 42') def foo(a:int=1, *args, b, c=None, **kwargs) -> 42: pass self.assertEqual(str(inspect.signature(foo)), - '(a: \'int\' = 1, *args, b, c=None, **kwargs) -> \'42\'') + '(a: int = 1, *args, b, c=None, **kwargs) -> 42') def foo(): pass @@ -3194,8 +3198,8 @@ class TestSignatureObject(unittest.TestCase): self.assertIs(sig.return_annotation, None) sig = sig.replace(return_annotation=sig.empty) self.assertIs(sig.return_annotation, sig.empty) - sig = sig.replace(return_annotation='42') - self.assertEqual(sig.return_annotation, '42') + sig = sig.replace(return_annotation=42) + self.assertEqual(sig.return_annotation, 42) self.assertEqual(sig, inspect.signature(test)) def test_signature_on_mangled_parameters(self): @@ -3207,8 +3211,8 @@ class TestSignatureObject(unittest.TestCase): self.assertEqual(self.signature(Spam.foo), ((('self', ..., ..., "positional_or_keyword"), - ('_Spam__p1', 2, '1', "positional_or_keyword"), - ('_Spam__p2', 3, '2', "keyword_only")), + ('_Spam__p1', 2, 1, "positional_or_keyword"), + ('_Spam__p2', 3, 2, "keyword_only")), ...)) self.assertEqual(self.signature(Spam.foo), @@ -3253,13 +3257,13 @@ class TestSignatureObject(unittest.TestCase): def test_signature_annotations_with_local_namespaces(self): class Foo: ... def func(foo: Foo) -> int: pass - def func2(foo: Foo, bar: Bar) -> int: pass + def func2(foo: Foo, bar: 'Bar') -> int: pass for signature_func in (inspect.signature, inspect.Signature.from_callable): with self.subTest(signature_func = signature_func): sig1 = signature_func(func) - self.assertEqual(sig1.return_annotation, 'int') - self.assertEqual(sig1.parameters['foo'].annotation, 'Foo') + self.assertEqual(sig1.return_annotation, int) + self.assertEqual(sig1.parameters['foo'].annotation, Foo) sig2 = signature_func(func, localns=locals()) self.assertEqual(sig2.return_annotation, int) @@ -3268,7 +3272,7 @@ class TestSignatureObject(unittest.TestCase): sig3 = signature_func(func2, globalns={'Bar': int}, localns=locals()) self.assertEqual(sig3.return_annotation, int) self.assertEqual(sig3.parameters['foo'].annotation, Foo) - self.assertEqual(sig3.parameters['bar'].annotation, int) + self.assertEqual(sig3.parameters['bar'].annotation, 'Bar') class TestParameterObject(unittest.TestCase): diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py index 4be78a4e62b..d43a8303b17 100644 --- a/Lib/test/test_opcodes.py +++ b/Lib/test/test_opcodes.py @@ -39,7 +39,7 @@ class OpcodeTest(unittest.TestCase): def test_use_existing_annotations(self): ns = {'__annotations__': {1: 2}} exec('x: int', ns) - self.assertEqual(ns['__annotations__'], {'x': 'int', 1: 2}) + self.assertEqual(ns['__annotations__'], {'x': int, 1: 2}) def test_do_not_recreate_annotations(self): # Don't rely on the existence of the '__annotations__' global. diff --git a/Lib/test/test_positional_only_arg.py b/Lib/test/test_positional_only_arg.py index 1fe8256d46e..0a9503e2025 100644 --- a/Lib/test/test_positional_only_arg.py +++ b/Lib/test/test_positional_only_arg.py @@ -302,14 +302,14 @@ class PositionalOnlyTestCase(unittest.TestCase): def f(x: int, /): ... return f - assert inner_has_pos_only().__annotations__ == {'x': 'int'} + assert inner_has_pos_only().__annotations__ == {'x': int} class Something: def method(self): def f(x: int, /): ... return f - assert Something().method().__annotations__ == {'x': 'int'} + assert Something().method().__annotations__ == {'x': int} def multiple_levels(): def inner_has_pos_only(): @@ -317,7 +317,7 @@ class PositionalOnlyTestCase(unittest.TestCase): return f return inner_has_pos_only() - assert multiple_levels().__annotations__ == {'x': 'int'} + assert multiple_levels().__annotations__ == {'x': int} def test_same_keyword_as_positional_with_kwargs(self): def f(something,/,**kwargs): @@ -429,6 +429,17 @@ class PositionalOnlyTestCase(unittest.TestCase): self.assertEqual(C().method(), sentinel) + def test_annotations_constant_fold(self): + def g(): + def f(x: not (int is int), /): ... + + # without constant folding we end up with + # COMPARE_OP(is), IS_OP (0) + # with constant folding we should expect a IS_OP (1) + codes = [(i.opname, i.argval) for i in dis.get_instructions(g)] + self.assertNotIn(('UNARY_NOT', None), codes) + self.assertIn(('IS_OP', 1), codes) + if __name__ == "__main__": unittest.main() diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 9bde0c75bc9..c862a805bbc 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -81,7 +81,7 @@ CLASSES |\x20\x20 | NO_MEANING = 'eggs' |\x20\x20 - | __annotations__ = {'NO_MEANING': 'str'} + | __annotations__ = {'NO_MEANING': } \x20\x20\x20\x20 class C(builtins.object) | Methods defined here: @@ -194,7 +194,7 @@ Data descriptors defined here:
Data and other attributes defined here:
NO_MEANING = 'eggs'
-
__annotations__ = {'NO_MEANING': 'str'}
+
__annotations__ = {'NO_MEANING': <class 'str'>}

diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 4d8198e5db6..5f622b092f9 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -1018,6 +1018,14 @@ Corner-cases that used to fail to raise the correct error: Traceback (most recent call last): SyntaxError: cannot assign to __debug__ + >>> def f(*args:(lambda __debug__:0)): pass + Traceback (most recent call last): + SyntaxError: cannot assign to __debug__ + + >>> def f(**kwargs:(lambda __debug__:0)): pass + Traceback (most recent call last): + SyntaxError: cannot assign to __debug__ + >>> with (lambda *:0): pass Traceback (most recent call last): SyntaxError: named arguments must follow bare * diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index d8a48ce36f6..25ebec5fa55 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -671,8 +671,8 @@ class TypesTests(unittest.TestCase): ForwardBefore = 'Forward' | T def forward_after(x: ForwardAfter[int]) -> None: ... def forward_before(x: ForwardBefore[int]) -> None: ... - assert typing.get_args(typing.get_type_hints(forward_after, localns=locals())['x']) == (int, Forward) - assert typing.get_args(typing.get_type_hints(forward_before, localns=locals())['x']) == (int, Forward) + assert typing.get_args(typing.get_type_hints(forward_after)['x']) == (int, Forward) + assert typing.get_args(typing.get_type_hints(forward_before)['x']) == (int, Forward) def test_or_type_operator_with_Protocol(self): class Proto(typing.Protocol): diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 50723c4df19..99417d7d364 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -363,7 +363,7 @@ class UnionTests(BaseTestCase): def test_no_eval_union(self): u = Union[int, str] def f(x: u): ... - self.assertIs(get_type_hints(f, globals(), locals())['x'], u) + self.assertIs(get_type_hints(f)['x'], u) def test_function_repr_union(self): def fun() -> int: ... @@ -2876,7 +2876,7 @@ class GetTypeHintTests(BaseTestCase): self.assertEqual(gth(HasForeignBaseClass), {'some_xrepr': XRepr, 'other_a': mod_generics_cache.A, 'some_b': mod_generics_cache.B}) - self.assertEqual(gth(XRepr), + self.assertEqual(gth(XRepr.__new__), {'x': int, 'y': int}) self.assertEqual(gth(mod_generics_cache.B), {'my_inner_a1': mod_generics_cache.B.A, @@ -3689,7 +3689,7 @@ class NamedTupleTests(BaseTestCase): self.assertEqual(tim.cool, 9000) self.assertEqual(CoolEmployee.__name__, 'CoolEmployee') self.assertEqual(CoolEmployee._fields, ('name', 'cool')) - self.assertEqual(gth(CoolEmployee), + self.assertEqual(CoolEmployee.__annotations__, collections.OrderedDict(name=str, cool=int)) def test_annotation_usage_with_default(self): @@ -3703,7 +3703,7 @@ class NamedTupleTests(BaseTestCase): self.assertEqual(CoolEmployeeWithDefault.__name__, 'CoolEmployeeWithDefault') self.assertEqual(CoolEmployeeWithDefault._fields, ('name', 'cool')) - self.assertEqual(gth(CoolEmployeeWithDefault), + self.assertEqual(CoolEmployeeWithDefault.__annotations__, dict(name=str, cool=int)) self.assertEqual(CoolEmployeeWithDefault._field_defaults, dict(cool=0)) @@ -3871,7 +3871,7 @@ class TypedDictTests(BaseTestCase): def test_py36_class_syntax_usage(self): self.assertEqual(LabelPoint2D.__name__, 'LabelPoint2D') self.assertEqual(LabelPoint2D.__module__, __name__) - self.assertEqual(gth(LabelPoint2D), {'x': int, 'y': int, 'label': str}) + self.assertEqual(LabelPoint2D.__annotations__, {'x': int, 'y': int, 'label': str}) self.assertEqual(LabelPoint2D.__bases__, (dict,)) self.assertEqual(LabelPoint2D.__total__, True) self.assertNotIsSubclass(LabelPoint2D, typing.Sequence) @@ -3934,11 +3934,11 @@ class TypedDictTests(BaseTestCase): assert BaseAnimal.__required_keys__ == frozenset(['name']) assert BaseAnimal.__optional_keys__ == frozenset([]) - assert gth(BaseAnimal) == {'name': str} + assert BaseAnimal.__annotations__ == {'name': str} assert Animal.__required_keys__ == frozenset(['name']) assert Animal.__optional_keys__ == frozenset(['tail', 'voice']) - assert gth(Animal) == { + assert Animal.__annotations__ == { 'name': str, 'tail': bool, 'voice': str, @@ -3946,7 +3946,7 @@ class TypedDictTests(BaseTestCase): assert Cat.__required_keys__ == frozenset(['name', 'fur_color']) assert Cat.__optional_keys__ == frozenset(['tail', 'voice']) - assert gth(Cat) == { + assert Cat.__annotations__ == { 'fur_color': str, 'name': str, 'tail': bool, @@ -3967,7 +3967,7 @@ class IOTests(BaseTestCase): def stuff(a: IO) -> AnyStr: return a.readline() - a = gth(stuff)['a'] + a = stuff.__annotations__['a'] self.assertEqual(a.__parameters__, (AnyStr,)) def test_textio(self): @@ -3975,7 +3975,7 @@ class IOTests(BaseTestCase): def stuff(a: TextIO) -> str: return a.readline() - a = gth(stuff)['a'] + a = stuff.__annotations__['a'] self.assertEqual(a.__parameters__, ()) def test_binaryio(self): @@ -3983,7 +3983,7 @@ class IOTests(BaseTestCase): def stuff(a: BinaryIO) -> bytes: return a.readline() - a = gth(stuff)['a'] + a = stuff.__annotations__['a'] self.assertEqual(a.__parameters__, ()) def test_io_submodule(self): diff --git a/Lib/typing.py b/Lib/typing.py index ea66cf50a07..9a3a6a7725a 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -577,13 +577,6 @@ class ForwardRef(_Final, _root=True): def __init__(self, arg, is_argument=True): if not isinstance(arg, str): raise TypeError(f"Forward reference must be a string -- got {arg!r}") - - # Double-stringified forward references is a result of activating - # the 'annotations' future by default. This way, we eliminate them in - # the runtime. - if arg.startswith(("'", '\"')) and arg.endswith(("'", '"')): - arg = arg[1:-1] - try: code = compile(arg, '', 'eval') except SyntaxError: diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-04-20-22-17-47.bpo-38605.9eeCNZ.rst b/Misc/NEWS.d/next/Core and Builtins/2021-04-20-22-17-47.bpo-38605.9eeCNZ.rst new file mode 100644 index 00000000000..d289424fda3 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-04-20-22-17-47.bpo-38605.9eeCNZ.rst @@ -0,0 +1,5 @@ +Revert making ``from __future__ import annotations`` the default. This follows +the Steering Council decision to postpone PEP 563 changes to at least Python +3.11. See the original email for more information regarding the decision: +https://mail.python.org/archives/list/python-dev@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/. +Patch by Pablo Galindo. diff --git a/Python/ast_opt.c b/Python/ast_opt.c index 311e0c7a8aa..dea20da07e6 100644 --- a/Python/ast_opt.c +++ b/Python/ast_opt.c @@ -406,6 +406,7 @@ static int astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state static int astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); static int astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); static int astfold_keyword(keyword_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); +static int astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); static int astfold_withitem(withitem_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); static int astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); static int astfold_match_case(match_case_ty node_, PyArena *ctx_, _PyASTOptimizeState *state); @@ -625,11 +626,25 @@ astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState static int astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { + CALL_SEQ(astfold_arg, arg, node_->posonlyargs); + CALL_SEQ(astfold_arg, arg, node_->args); + CALL_OPT(astfold_arg, arg_ty, node_->vararg); + CALL_SEQ(astfold_arg, arg, node_->kwonlyargs); CALL_SEQ(astfold_expr, expr, node_->kw_defaults); + CALL_OPT(astfold_arg, arg_ty, node_->kwarg); CALL_SEQ(astfold_expr, expr, node_->defaults); return 1; } +static int +astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) +{ + if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { + CALL_OPT(astfold_expr, expr_ty, node_->annotation); + } + return 1; +} + static int astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) { @@ -638,11 +653,17 @@ astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) CALL(astfold_arguments, arguments_ty, node_->v.FunctionDef.args); CALL(astfold_body, asdl_seq, node_->v.FunctionDef.body); CALL_SEQ(astfold_expr, expr, node_->v.FunctionDef.decorator_list); + if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { + CALL_OPT(astfold_expr, expr_ty, node_->v.FunctionDef.returns); + } break; case AsyncFunctionDef_kind: CALL(astfold_arguments, arguments_ty, node_->v.AsyncFunctionDef.args); CALL(astfold_body, asdl_seq, node_->v.AsyncFunctionDef.body); CALL_SEQ(astfold_expr, expr, node_->v.AsyncFunctionDef.decorator_list); + if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { + CALL_OPT(astfold_expr, expr_ty, node_->v.AsyncFunctionDef.returns); + } break; case ClassDef_kind: CALL_SEQ(astfold_expr, expr, node_->v.ClassDef.bases); @@ -666,6 +687,9 @@ astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) break; case AnnAssign_kind: CALL(astfold_expr, expr_ty, node_->v.AnnAssign.target); + if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) { + CALL(astfold_expr, expr_ty, node_->v.AnnAssign.annotation); + } CALL_OPT(astfold_expr, expr_ty, node_->v.AnnAssign.value); break; case For_kind: diff --git a/Python/compile.c b/Python/compile.c index 496b4b0371f..49a713b2b0c 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2111,16 +2111,24 @@ static int compiler_visit_argannotation(struct compiler *c, identifier id, expr_ty annotation, Py_ssize_t *annotations_len) { - if (annotation) { - PyObject *mangled = _Py_Mangle(c->u->u_private, id); - if (!mangled) - return 0; - - ADDOP_LOAD_CONST(c, mangled); - Py_DECREF(mangled); - VISIT(c, annexpr, annotation); - *annotations_len += 2; + if (!annotation) { + return 1; } + + PyObject *mangled = _Py_Mangle(c->u->u_private, id); + if (!mangled) { + return 0; + } + ADDOP_LOAD_CONST(c, mangled); + Py_DECREF(mangled); + + if (c->c_future->ff_features & CO_FUTURE_ANNOTATIONS) { + VISIT(c, annexpr, annotation) + } + else { + VISIT(c, expr, annotation); + } + *annotations_len += 2; return 1; } @@ -5403,7 +5411,12 @@ compiler_annassign(struct compiler *c, stmt_ty s) if (s->v.AnnAssign.simple && (c->u->u_scope_type == COMPILER_SCOPE_MODULE || c->u->u_scope_type == COMPILER_SCOPE_CLASS)) { - VISIT(c, annexpr, s->v.AnnAssign.annotation); + if (c->c_future->ff_features & CO_FUTURE_ANNOTATIONS) { + VISIT(c, annexpr, s->v.AnnAssign.annotation) + } + else { + VISIT(c, expr, s->v.AnnAssign.annotation); + } ADDOP_NAME(c, LOAD_NAME, __annotations__, names); mangled = _Py_Mangle(c->u->u_private, targ->v.Name.id); ADDOP_LOAD_CONST_NEW(c, mangled); diff --git a/Python/future.c b/Python/future.c index 05ade8e250a..d465608ca45 100644 --- a/Python/future.c +++ b/Python/future.c @@ -37,7 +37,7 @@ future_check_features(PyFutureFeatures *ff, stmt_ty s, PyObject *filename) } else if (strcmp(feature, FUTURE_GENERATOR_STOP) == 0) { continue; } else if (strcmp(feature, FUTURE_ANNOTATIONS) == 0) { - continue; + ff->ff_features |= CO_FUTURE_ANNOTATIONS; } else if (strcmp(feature, "braces") == 0) { PyErr_SetString(PyExc_SyntaxError, "not a chance"); diff --git a/Python/importlib_external.h b/Python/importlib_external.h index e242c36aa39..c5d3450b7c4 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -359,7 +359,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 99,185,0,0,0,115,38,0,0,0,16,5,6,1,22,1, 4,255,2,2,14,3,24,1,16,128,18,1,12,1,2,1, 12,1,2,3,12,254,2,1,2,1,2,254,2,253,255,128, - 114,95,0,0,0,105,108,13,0,0,114,44,0,0,0,114, + 114,95,0,0,0,105,109,13,0,0,114,44,0,0,0,114, 32,0,0,0,115,2,0,0,0,13,10,90,11,95,95,112, 121,99,97,99,104,101,95,95,122,4,111,112,116,45,122,3, 46,112,121,122,4,46,112,121,119,122,4,46,112,121,99,41, @@ -473,7 +473,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 103,90,15,97,108,109,111,115,116,95,102,105,108,101,110,97, 109,101,218,8,102,105,108,101,110,97,109,101,114,7,0,0, 0,114,7,0,0,0,114,8,0,0,0,218,17,99,97,99, - 104,101,95,102,114,111,109,95,115,111,117,114,99,101,121,1, + 104,101,95,102,114,111,109,95,115,111,117,114,99,101,122,1, 0,0,115,74,0,0,0,8,18,6,1,2,1,4,255,8, 2,4,1,8,1,12,1,10,1,12,1,16,1,8,1,8, 1,8,1,24,1,8,1,12,1,6,1,8,2,8,1,8, @@ -554,7 +554,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,90,9,111,112,116,95,108,101,118,101,108,90,13,98, 97,115,101,95,102,105,108,101,110,97,109,101,114,7,0,0, 0,114,7,0,0,0,114,8,0,0,0,218,17,115,111,117, - 114,99,101,95,102,114,111,109,95,99,97,99,104,101,192,1, + 114,99,101,95,102,114,111,109,95,99,97,99,104,101,193,1, 0,0,115,62,0,0,0,12,9,8,1,10,1,12,1,4, 1,10,1,12,1,14,1,16,1,4,1,4,1,12,1,8, 1,8,1,2,1,8,255,10,2,8,1,14,1,8,1,16, @@ -590,7 +590,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 101,110,115,105,111,110,218,11,115,111,117,114,99,101,95,112, 97,116,104,114,7,0,0,0,114,7,0,0,0,114,8,0, 0,0,218,15,95,103,101,116,95,115,111,117,114,99,101,102, - 105,108,101,232,1,0,0,115,24,0,0,0,12,7,4,1, + 105,108,101,233,1,0,0,115,24,0,0,0,12,7,4,1, 16,1,24,1,4,1,2,1,12,1,16,1,14,1,16,1, 2,254,255,128,114,135,0,0,0,99,1,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,8,0,0,0,67,0, @@ -603,7 +603,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,114,121,0,0,0,114,107,0,0,0,114,113,0, 0,0,41,1,114,120,0,0,0,114,7,0,0,0,114,7, 0,0,0,114,8,0,0,0,218,11,95,103,101,116,95,99, - 97,99,104,101,100,251,1,0,0,115,20,0,0,0,14,1, + 97,99,104,101,100,252,1,0,0,115,20,0,0,0,14,1, 2,1,10,1,12,1,6,1,14,1,4,1,4,2,2,251, 255,128,114,137,0,0,0,99,1,0,0,0,0,0,0,0, 0,0,0,0,2,0,0,0,8,0,0,0,67,0,0,0, @@ -617,7 +617,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,233,128,0,0,0,78,41,3,114,75,0,0,0,114,77, 0,0,0,114,76,0,0,0,41,2,114,65,0,0,0,114, 78,0,0,0,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,218,10,95,99,97,108,99,95,109,111,100,101,7, + 0,0,0,218,10,95,99,97,108,99,95,109,111,100,101,8, 2,0,0,115,16,0,0,0,2,2,14,1,12,1,6,1, 8,3,4,1,2,251,255,128,114,139,0,0,0,99,1,0, 0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0, @@ -655,7 +655,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,218,4,97,114,103,115,218,6,107,119,97,114,103,115, 169,1,218,6,109,101,116,104,111,100,114,7,0,0,0,114, 8,0,0,0,218,19,95,99,104,101,99,107,95,110,97,109, - 101,95,119,114,97,112,112,101,114,27,2,0,0,115,20,0, + 101,95,119,114,97,112,112,101,114,28,2,0,0,115,20,0, 0,0,8,1,8,1,10,1,4,1,8,1,2,255,2,1, 6,255,24,2,255,128,122,40,95,99,104,101,99,107,95,110, 97,109,101,46,60,108,111,99,97,108,115,62,46,95,99,104, @@ -673,7 +673,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 116,97,116,116,114,218,8,95,95,100,105,99,116,95,95,218, 6,117,112,100,97,116,101,41,3,90,3,110,101,119,90,3, 111,108,100,114,85,0,0,0,114,7,0,0,0,114,7,0, - 0,0,114,8,0,0,0,218,5,95,119,114,97,112,40,2, + 0,0,114,8,0,0,0,218,5,95,119,114,97,112,41,2, 0,0,115,12,0,0,0,8,1,10,1,18,1,2,128,18, 1,255,128,122,26,95,99,104,101,99,107,95,110,97,109,101, 46,60,108,111,99,97,108,115,62,46,95,119,114,97,112,114, @@ -681,7 +681,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 97,112,114,158,0,0,0,41,3,114,147,0,0,0,114,148, 0,0,0,114,158,0,0,0,114,7,0,0,0,114,146,0, 0,0,114,8,0,0,0,218,11,95,99,104,101,99,107,95, - 110,97,109,101,19,2,0,0,115,14,0,0,0,14,8,8, + 110,97,109,101,20,2,0,0,115,14,0,0,0,14,8,8, 10,8,1,8,2,10,6,4,1,255,128,114,160,0,0,0, 99,2,0,0,0,0,0,0,0,0,0,0,0,5,0,0, 0,6,0,0,0,67,0,0,0,115,72,0,0,0,116,0, @@ -716,7 +716,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 111,97,100,101,114,218,8,112,111,114,116,105,111,110,115,218, 3,109,115,103,114,7,0,0,0,114,7,0,0,0,114,8, 0,0,0,218,17,95,102,105,110,100,95,109,111,100,117,108, - 101,95,115,104,105,109,50,2,0,0,115,18,0,0,0,6, + 101,95,115,104,105,109,51,2,0,0,115,18,0,0,0,6, 7,2,2,4,254,14,6,16,1,4,1,22,1,4,1,255, 128,114,167,0,0,0,99,3,0,0,0,0,0,0,0,0, 0,0,0,6,0,0,0,4,0,0,0,67,0,0,0,115, @@ -784,7 +784,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 115,90,5,109,97,103,105,99,114,117,0,0,0,114,16,0, 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, 0,218,13,95,99,108,97,115,115,105,102,121,95,112,121,99, - 70,2,0,0,115,30,0,0,0,12,16,8,1,16,1,12, + 71,2,0,0,115,30,0,0,0,12,16,8,1,16,1,12, 1,16,1,12,1,10,1,12,1,8,1,16,1,8,2,16, 1,16,1,4,1,255,128,114,176,0,0,0,99,5,0,0, 0,0,0,0,0,0,0,0,0,6,0,0,0,4,0,0, @@ -839,7 +839,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,114,175,0,0,0,114,117,0,0,0,114,7,0, 0,0,114,7,0,0,0,114,8,0,0,0,218,23,95,118, 97,108,105,100,97,116,101,95,116,105,109,101,115,116,97,109, - 112,95,112,121,99,103,2,0,0,115,20,0,0,0,24,19, + 112,95,112,121,99,104,2,0,0,115,20,0,0,0,24,19, 10,1,12,1,16,1,8,1,22,1,2,255,22,2,8,254, 255,128,114,180,0,0,0,99,4,0,0,0,0,0,0,0, 0,0,0,0,4,0,0,0,4,0,0,0,67,0,0,0, @@ -885,7 +885,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,218,11,115,111,117,114,99,101,95,104,97,115,104,114, 141,0,0,0,114,175,0,0,0,114,7,0,0,0,114,7, 0,0,0,114,8,0,0,0,218,18,95,118,97,108,105,100, - 97,116,101,95,104,97,115,104,95,112,121,99,131,2,0,0, + 97,116,101,95,104,97,115,104,95,112,121,99,132,2,0,0, 115,16,0,0,0,16,17,2,1,8,1,4,255,2,2,6, 254,4,255,255,128,114,182,0,0,0,99,4,0,0,0,0, 0,0,0,0,0,0,0,5,0,0,0,5,0,0,0,67, @@ -909,7 +909,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 114,41,0,0,0,114,141,0,0,0,114,132,0,0,0,114, 134,0,0,0,218,4,99,111,100,101,114,7,0,0,0,114, 7,0,0,0,114,8,0,0,0,218,17,95,99,111,109,112, - 105,108,101,95,98,121,116,101,99,111,100,101,155,2,0,0, + 105,108,101,95,98,121,116,101,99,111,100,101,156,2,0,0, 115,20,0,0,0,10,2,10,1,12,1,8,1,12,1,4, 1,10,2,4,1,6,255,255,128,114,189,0,0,0,99,3, 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,5, @@ -928,7 +928,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 114,179,0,0,0,114,41,0,0,0,114,7,0,0,0,114, 7,0,0,0,114,8,0,0,0,218,22,95,99,111,100,101, 95,116,111,95,116,105,109,101,115,116,97,109,112,95,112,121, - 99,168,2,0,0,115,14,0,0,0,8,2,14,1,14,1, + 99,169,2,0,0,115,14,0,0,0,8,2,14,1,14,1, 14,1,16,1,4,1,255,128,114,194,0,0,0,84,99,3, 0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,5, 0,0,0,67,0,0,0,115,80,0,0,0,116,0,116,1, @@ -946,7 +946,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,90,7,99,104,101,99,107,101,100,114,41,0,0,0, 114,16,0,0,0,114,7,0,0,0,114,7,0,0,0,114, 8,0,0,0,218,17,95,99,111,100,101,95,116,111,95,104, - 97,115,104,95,112,121,99,178,2,0,0,115,16,0,0,0, + 97,115,104,95,112,121,99,179,2,0,0,115,16,0,0,0, 8,2,12,1,14,1,16,1,10,1,16,1,4,1,255,128, 114,195,0,0,0,99,1,0,0,0,0,0,0,0,0,0, 0,0,5,0,0,0,6,0,0,0,67,0,0,0,115,62, @@ -974,7 +974,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 105,110,103,90,15,110,101,119,108,105,110,101,95,100,101,99, 111,100,101,114,114,7,0,0,0,114,7,0,0,0,114,8, 0,0,0,218,13,100,101,99,111,100,101,95,115,111,117,114, - 99,101,189,2,0,0,115,12,0,0,0,8,5,12,1,10, + 99,101,190,2,0,0,115,12,0,0,0,8,5,12,1,10, 1,12,1,20,1,255,128,114,200,0,0,0,169,2,114,164, 0,0,0,218,26,115,117,98,109,111,100,117,108,101,95,115, 101,97,114,99,104,95,108,111,99,97,116,105,111,110,115,99, @@ -1039,7 +1039,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,90,7,100,105,114,110,97,109,101,114,7,0,0, 0,114,7,0,0,0,114,8,0,0,0,218,23,115,112,101, 99,95,102,114,111,109,95,102,105,108,101,95,108,111,99,97, - 116,105,111,110,206,2,0,0,115,86,0,0,0,8,12,4, + 116,105,111,110,207,2,0,0,115,86,0,0,0,8,12,4, 4,10,1,2,2,14,1,12,1,4,1,2,251,10,7,8, 1,2,1,18,1,12,1,2,1,16,8,6,1,8,3,14, 1,14,1,10,1,6,1,4,1,2,253,4,5,8,3,10, @@ -1078,7 +1078,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 18,72,75,69,89,95,76,79,67,65,76,95,77,65,67,72, 73,78,69,114,19,0,0,0,114,7,0,0,0,114,7,0, 0,0,114,8,0,0,0,218,14,95,111,112,101,110,95,114, - 101,103,105,115,116,114,121,35,3,0,0,115,12,0,0,0, + 101,103,105,115,116,114,121,36,3,0,0,115,12,0,0,0, 2,2,16,1,12,1,18,1,2,255,255,128,122,36,87,105, 110,100,111,119,115,82,101,103,105,115,116,114,121,70,105,110, 100,101,114,46,95,111,112,101,110,95,114,101,103,105,115,116, @@ -1105,7 +1105,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 115,116,114,121,95,107,101,121,114,20,0,0,0,90,4,104, 107,101,121,218,8,102,105,108,101,112,97,116,104,114,7,0, 0,0,114,7,0,0,0,114,8,0,0,0,218,16,95,115, - 101,97,114,99,104,95,114,101,103,105,115,116,114,121,42,3, + 101,97,114,99,104,95,114,101,103,105,115,116,114,121,43,3, 0,0,115,30,0,0,0,6,2,8,1,6,2,6,1,16, 1,6,255,2,2,12,1,26,1,18,128,4,3,12,254,6, 1,2,255,255,128,122,38,87,105,110,100,111,119,115,82,101, @@ -1128,7 +1128,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 65,0,0,0,218,6,116,97,114,103,101,116,114,222,0,0, 0,114,164,0,0,0,114,212,0,0,0,114,210,0,0,0, 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,218, - 9,102,105,110,100,95,115,112,101,99,57,3,0,0,115,36, + 9,102,105,110,100,95,115,112,101,99,58,3,0,0,115,36, 0,0,0,10,2,8,1,4,1,2,1,12,1,12,1,6, 1,14,1,14,1,6,1,8,1,2,1,6,254,8,3,2, 252,4,255,2,254,255,128,122,31,87,105,110,100,111,119,115, @@ -1156,7 +1156,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,114,226,0,0,0,114,164,0,0,0,169,4,114,221, 0,0,0,114,163,0,0,0,114,65,0,0,0,114,210,0, 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, - 0,218,11,102,105,110,100,95,109,111,100,117,108,101,73,3, + 0,218,11,102,105,110,100,95,109,111,100,117,108,101,74,3, 0,0,115,16,0,0,0,6,7,2,2,4,254,12,3,8, 1,6,1,4,2,255,128,122,33,87,105,110,100,111,119,115, 82,101,103,105,115,116,114,121,70,105,110,100,101,114,46,102, @@ -1170,7 +1170,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 97,115,115,109,101,116,104,111,100,114,223,0,0,0,114,226, 0,0,0,114,229,0,0,0,114,7,0,0,0,114,7,0, 0,0,114,7,0,0,0,114,8,0,0,0,114,214,0,0, - 0,23,3,0,0,115,32,0,0,0,8,0,4,2,2,3, + 0,24,3,0,0,115,32,0,0,0,8,0,4,2,2,3, 2,255,2,4,2,255,12,3,2,2,10,1,2,6,10,1, 2,14,12,1,2,15,16,1,255,128,114,214,0,0,0,99, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -1206,7 +1206,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,114,120,0,0,0,90,13,102,105,108,101,110,97, 109,101,95,98,97,115,101,90,9,116,97,105,108,95,110,97, 109,101,114,7,0,0,0,114,7,0,0,0,114,8,0,0, - 0,114,206,0,0,0,95,3,0,0,115,10,0,0,0,18, + 0,114,206,0,0,0,96,3,0,0,115,10,0,0,0,18, 3,16,1,14,1,16,1,255,128,122,24,95,76,111,97,100, 101,114,66,97,115,105,99,115,46,105,115,95,112,97,99,107, 97,103,101,99,2,0,0,0,0,0,0,0,0,0,0,0, @@ -1216,7 +1216,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 111,100,117,108,101,32,99,114,101,97,116,105,111,110,46,78, 114,7,0,0,0,169,2,114,143,0,0,0,114,210,0,0, 0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, - 218,13,99,114,101,97,116,101,95,109,111,100,117,108,101,103, + 218,13,99,114,101,97,116,101,95,109,111,100,117,108,101,104, 3,0,0,243,4,0,0,0,4,0,255,128,122,27,95,76, 111,97,100,101,114,66,97,115,105,99,115,46,99,114,101,97, 116,101,95,109,111,100,117,108,101,99,2,0,0,0,0,0, @@ -1237,7 +1237,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,41,3,114,143,0,0,0,218,6,109,111,100,117, 108,101,114,188,0,0,0,114,7,0,0,0,114,7,0,0, 0,114,8,0,0,0,218,11,101,120,101,99,95,109,111,100, - 117,108,101,106,3,0,0,115,14,0,0,0,12,2,8,1, + 117,108,101,107,3,0,0,115,14,0,0,0,12,2,8,1, 4,1,8,1,4,255,20,2,255,128,122,25,95,76,111,97, 100,101,114,66,97,115,105,99,115,46,101,120,101,99,95,109, 111,100,117,108,101,99,2,0,0,0,0,0,0,0,0,0, @@ -1249,13 +1249,13 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 117,108,101,95,115,104,105,109,169,2,114,143,0,0,0,114, 163,0,0,0,114,7,0,0,0,114,7,0,0,0,114,8, 0,0,0,218,11,108,111,97,100,95,109,111,100,117,108,101, - 114,3,0,0,115,4,0,0,0,12,3,255,128,122,25,95, + 115,3,0,0,115,4,0,0,0,12,3,255,128,122,25,95, 76,111,97,100,101,114,66,97,115,105,99,115,46,108,111,97, 100,95,109,111,100,117,108,101,78,41,8,114,150,0,0,0, 114,149,0,0,0,114,151,0,0,0,114,152,0,0,0,114, 206,0,0,0,114,239,0,0,0,114,245,0,0,0,114,248, 0,0,0,114,7,0,0,0,114,7,0,0,0,114,7,0, - 0,0,114,8,0,0,0,114,235,0,0,0,90,3,0,0, + 0,0,114,8,0,0,0,114,235,0,0,0,91,3,0,0, 115,14,0,0,0,8,0,4,2,8,3,8,8,8,3,12, 8,255,128,114,235,0,0,0,99,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,3,0,0,0,64,0,0, @@ -1280,7 +1280,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 100,46,10,32,32,32,32,32,32,32,32,78,41,1,114,76, 0,0,0,169,2,114,143,0,0,0,114,65,0,0,0,114, 7,0,0,0,114,7,0,0,0,114,8,0,0,0,218,10, - 112,97,116,104,95,109,116,105,109,101,122,3,0,0,115,4, + 112,97,116,104,95,109,116,105,109,101,123,3,0,0,115,4, 0,0,0,4,6,255,128,122,23,83,111,117,114,99,101,76, 111,97,100,101,114,46,112,97,116,104,95,109,116,105,109,101, 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, @@ -1314,7 +1314,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 104,97,110,100,108,101,100,46,10,32,32,32,32,32,32,32, 32,114,193,0,0,0,78,41,1,114,251,0,0,0,114,250, 0,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,218,10,112,97,116,104,95,115,116,97,116,115,130,3, + 0,0,218,10,112,97,116,104,95,115,116,97,116,115,131,3, 0,0,115,4,0,0,0,14,12,255,128,122,23,83,111,117, 114,99,101,76,111,97,100,101,114,46,112,97,116,104,95,115, 116,97,116,115,99,4,0,0,0,0,0,0,0,0,0,0, @@ -1339,7 +1339,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 10,99,97,99,104,101,95,112,97,116,104,114,41,0,0,0, 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,218, 15,95,99,97,99,104,101,95,98,121,116,101,99,111,100,101, - 144,3,0,0,115,4,0,0,0,12,8,255,128,122,28,83, + 145,3,0,0,115,4,0,0,0,12,8,255,128,122,28,83, 111,117,114,99,101,76,111,97,100,101,114,46,95,99,97,99, 104,101,95,98,121,116,101,99,111,100,101,99,3,0,0,0, 0,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0, @@ -1355,7 +1355,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 111,100,101,32,102,105,108,101,115,46,10,32,32,32,32,32, 32,32,32,78,114,7,0,0,0,41,3,114,143,0,0,0, 114,65,0,0,0,114,41,0,0,0,114,7,0,0,0,114, - 7,0,0,0,114,8,0,0,0,114,253,0,0,0,154,3, + 7,0,0,0,114,8,0,0,0,114,253,0,0,0,155,3, 0,0,114,240,0,0,0,122,21,83,111,117,114,99,101,76, 111,97,100,101,114,46,115,101,116,95,100,97,116,97,99,2, 0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,10, @@ -1375,7 +1375,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 142,0,0,0,114,200,0,0,0,41,5,114,143,0,0,0, 114,163,0,0,0,114,65,0,0,0,114,198,0,0,0,218, 3,101,120,99,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,218,10,103,101,116,95,115,111,117,114,99,101,161, + 0,0,0,218,10,103,101,116,95,115,111,117,114,99,101,162, 3,0,0,115,26,0,0,0,10,2,2,1,12,1,8,4, 14,253,4,1,2,1,4,255,2,1,2,255,8,128,2,255, 255,128,122,23,83,111,117,114,99,101,76,111,97,100,101,114, @@ -1398,7 +1398,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 7,99,111,109,112,105,108,101,41,4,114,143,0,0,0,114, 41,0,0,0,114,65,0,0,0,114,2,1,0,0,114,7, 0,0,0,114,7,0,0,0,114,8,0,0,0,218,14,115, - 111,117,114,99,101,95,116,111,95,99,111,100,101,171,3,0, + 111,117,114,99,101,95,116,111,95,99,111,100,101,172,3,0, 0,115,8,0,0,0,12,5,4,1,6,255,255,128,122,27, 83,111,117,114,99,101,76,111,97,100,101,114,46,115,111,117, 114,99,101,95,116,111,95,99,111,100,101,99,2,0,0,0, @@ -1475,7 +1475,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 16,0,0,0,90,10,98,121,116,101,115,95,100,97,116,97, 90,11,99,111,100,101,95,111,98,106,101,99,116,114,7,0, 0,0,114,7,0,0,0,114,8,0,0,0,114,241,0,0, - 0,179,3,0,0,115,170,0,0,0,10,7,4,1,4,1, + 0,180,3,0,0,115,170,0,0,0,10,7,4,1,4,1, 4,1,4,1,4,1,2,1,12,1,14,1,8,1,2,2, 14,1,14,1,4,1,12,2,2,1,14,1,14,1,4,1, 2,3,2,1,6,254,2,4,12,1,16,1,12,1,4,1, @@ -1492,7 +1492,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,114,252,0,0,0,114,254,0,0,0,114,253,0,0, 0,114,1,1,0,0,114,5,1,0,0,114,241,0,0,0, 114,7,0,0,0,114,7,0,0,0,114,7,0,0,0,114, - 8,0,0,0,114,249,0,0,0,120,3,0,0,115,18,0, + 8,0,0,0,114,249,0,0,0,121,3,0,0,115,18,0, 0,0,8,0,8,2,8,8,8,14,8,10,8,7,14,10, 12,8,255,128,114,249,0,0,0,99,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0, @@ -1520,7 +1520,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 102,105,110,100,101,114,46,78,114,183,0,0,0,41,3,114, 143,0,0,0,114,163,0,0,0,114,65,0,0,0,114,7, 0,0,0,114,7,0,0,0,114,8,0,0,0,114,236,0, - 0,0,13,4,0,0,115,6,0,0,0,6,3,10,1,255, + 0,0,14,4,0,0,115,6,0,0,0,6,3,10,1,255, 128,122,19,70,105,108,101,76,111,97,100,101,114,46,95,95, 105,110,105,116,95,95,99,2,0,0,0,0,0,0,0,0, 0,0,0,2,0,0,0,2,0,0,0,67,0,0,0,243, @@ -1529,7 +1529,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,169,2,218,9,95,95,99,108,97,115,115,95,95,114,156, 0,0,0,169,2,114,143,0,0,0,90,5,111,116,104,101, 114,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, - 218,6,95,95,101,113,95,95,19,4,0,0,243,8,0,0, + 218,6,95,95,101,113,95,95,20,4,0,0,243,8,0,0, 0,12,1,10,1,2,255,255,128,122,17,70,105,108,101,76, 111,97,100,101,114,46,95,95,101,113,95,95,99,1,0,0, 0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0, @@ -1538,7 +1538,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,169,3,218,4,104,97,115,104,114,141,0,0,0, 114,65,0,0,0,169,1,114,143,0,0,0,114,7,0,0, 0,114,7,0,0,0,114,8,0,0,0,218,8,95,95,104, - 97,115,104,95,95,23,4,0,0,243,4,0,0,0,20,1, + 97,115,104,95,95,24,4,0,0,243,4,0,0,0,20,1, 255,128,122,19,70,105,108,101,76,111,97,100,101,114,46,95, 95,104,97,115,104,95,95,99,2,0,0,0,0,0,0,0, 0,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0, @@ -1552,7 +1552,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 97,100,46,10,10,32,32,32,32,32,32,32,32,78,41,3, 218,5,115,117,112,101,114,114,11,1,0,0,114,248,0,0, 0,114,247,0,0,0,169,1,114,14,1,0,0,114,7,0, - 0,0,114,8,0,0,0,114,248,0,0,0,26,4,0,0, + 0,0,114,8,0,0,0,114,248,0,0,0,27,4,0,0, 115,4,0,0,0,16,10,255,128,122,22,70,105,108,101,76, 111,97,100,101,114,46,108,111,97,100,95,109,111,100,117,108, 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, @@ -1563,7 +1563,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 111,117,110,100,32,98,121,32,116,104,101,32,102,105,110,100, 101,114,46,78,114,71,0,0,0,114,247,0,0,0,114,7, 0,0,0,114,7,0,0,0,114,8,0,0,0,114,203,0, - 0,0,38,4,0,0,243,4,0,0,0,6,3,255,128,122, + 0,0,39,4,0,0,243,4,0,0,0,6,3,255,128,122, 23,70,105,108,101,76,111,97,100,101,114,46,103,101,116,95, 102,105,108,101,110,97,109,101,99,2,0,0,0,0,0,0, 0,0,0,0,0,3,0,0,0,8,0,0,0,67,0,0, @@ -1584,7 +1584,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 110,95,99,111,100,101,114,109,0,0,0,90,4,114,101,97, 100,114,92,0,0,0,41,3,114,143,0,0,0,114,65,0, 0,0,114,94,0,0,0,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,255,0,0,0,43,4,0,0,115, + 0,114,8,0,0,0,114,255,0,0,0,44,4,0,0,115, 16,0,0,0,14,2,16,1,22,1,20,128,14,2,22,1, 20,128,255,128,122,19,70,105,108,101,76,111,97,100,101,114, 46,103,101,116,95,100,97,116,97,99,2,0,0,0,0,0, @@ -1597,7 +1597,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,114,244,0,0,0,114,31,1,0,0,114,7,0,0, 0,114,7,0,0,0,114,8,0,0,0,218,19,103,101,116, 95,114,101,115,111,117,114,99,101,95,114,101,97,100,101,114, - 52,4,0,0,115,6,0,0,0,12,2,8,1,255,128,122, + 53,4,0,0,115,6,0,0,0,12,2,8,1,255,128,122, 30,70,105,108,101,76,111,97,100,101,114,46,103,101,116,95, 114,101,115,111,117,114,99,101,95,114,101,97,100,101,114,41, 13,114,150,0,0,0,114,149,0,0,0,114,151,0,0,0, @@ -1606,7 +1606,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,114,255,0,0,0,114,33,1,0,0,90,13,95, 95,99,108,97,115,115,99,101,108,108,95,95,114,7,0,0, 0,114,7,0,0,0,114,25,1,0,0,114,8,0,0,0, - 114,11,1,0,0,8,4,0,0,115,26,0,0,0,8,0, + 114,11,1,0,0,9,4,0,0,115,26,0,0,0,8,0, 4,2,8,3,8,6,8,4,2,3,14,1,2,11,10,1, 8,4,2,9,18,1,255,128,114,11,1,0,0,99,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0, @@ -1629,7 +1629,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 116,105,109,101,90,7,115,116,95,115,105,122,101,41,3,114, 143,0,0,0,114,65,0,0,0,114,10,1,0,0,114,7, 0,0,0,114,7,0,0,0,114,8,0,0,0,114,252,0, - 0,0,62,4,0,0,115,6,0,0,0,8,2,14,1,255, + 0,0,63,4,0,0,115,6,0,0,0,8,2,14,1,255, 128,122,27,83,111,117,114,99,101,70,105,108,101,76,111,97, 100,101,114,46,112,97,116,104,95,115,116,97,116,115,99,4, 0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,5, @@ -1639,7 +1639,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 41,2,114,139,0,0,0,114,253,0,0,0,41,5,114,143, 0,0,0,114,134,0,0,0,114,132,0,0,0,114,41,0, 0,0,114,78,0,0,0,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,254,0,0,0,67,4,0,0,115, + 0,114,8,0,0,0,114,254,0,0,0,68,4,0,0,115, 6,0,0,0,8,2,16,1,255,128,122,32,83,111,117,114, 99,101,70,105,108,101,76,111,97,100,101,114,46,95,99,97, 99,104,101,95,98,121,116,101,99,111,100,101,114,87,0,0, @@ -1675,7 +1675,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 37,1,0,0,218,6,112,97,114,101,110,116,114,120,0,0, 0,114,63,0,0,0,114,68,0,0,0,114,0,1,0,0, 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,114, - 253,0,0,0,72,4,0,0,115,58,0,0,0,12,2,4, + 253,0,0,0,73,4,0,0,115,58,0,0,0,12,2,4, 1,12,2,12,1,10,1,12,254,12,4,10,1,2,1,14, 1,12,1,4,2,14,1,6,3,4,1,4,255,16,2,8, 128,2,1,12,1,18,1,14,1,8,2,2,1,18,255,8, @@ -1685,7 +1685,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 151,0,0,0,114,152,0,0,0,114,252,0,0,0,114,254, 0,0,0,114,253,0,0,0,114,7,0,0,0,114,7,0, 0,0,114,7,0,0,0,114,8,0,0,0,114,34,1,0, - 0,58,4,0,0,115,12,0,0,0,8,0,4,2,8,2, + 0,59,4,0,0,115,12,0,0,0,8,0,4,2,8,2, 8,5,18,5,255,128,114,34,1,0,0,99,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, 64,0,0,0,115,32,0,0,0,101,0,90,1,100,0,90, @@ -1707,7 +1707,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,114,7,1,0,0,41,5,114,143,0,0,0,114,163,0, 0,0,114,65,0,0,0,114,41,0,0,0,114,175,0,0, 0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, - 114,241,0,0,0,107,4,0,0,115,24,0,0,0,10,1, + 114,241,0,0,0,108,4,0,0,115,24,0,0,0,10,1, 10,1,2,4,2,1,6,254,12,4,2,1,14,1,2,1, 2,1,6,253,255,128,122,29,83,111,117,114,99,101,108,101, 115,115,70,105,108,101,76,111,97,100,101,114,46,103,101,116, @@ -1717,14 +1717,14 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 110,101,32,97,115,32,116,104,101,114,101,32,105,115,32,110, 111,32,115,111,117,114,99,101,32,99,111,100,101,46,78,114, 7,0,0,0,114,247,0,0,0,114,7,0,0,0,114,7, - 0,0,0,114,8,0,0,0,114,1,1,0,0,123,4,0, + 0,0,0,114,8,0,0,0,114,1,1,0,0,124,4,0, 0,114,24,0,0,0,122,31,83,111,117,114,99,101,108,101, 115,115,70,105,108,101,76,111,97,100,101,114,46,103,101,116, 95,115,111,117,114,99,101,78,41,6,114,150,0,0,0,114, 149,0,0,0,114,151,0,0,0,114,152,0,0,0,114,241, 0,0,0,114,1,1,0,0,114,7,0,0,0,114,7,0, 0,0,114,7,0,0,0,114,8,0,0,0,114,41,1,0, - 0,103,4,0,0,115,10,0,0,0,8,0,4,2,8,2, + 0,104,4,0,0,115,10,0,0,0,8,0,4,2,8,2, 12,16,255,128,114,41,1,0,0,99,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,3,0,0,0,64,0, 0,0,115,92,0,0,0,101,0,90,1,100,0,90,2,100, @@ -1745,20 +1745,20 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,95,1,100,0,83,0,114,69,0,0,0,114,183,0,0, 0,41,3,114,143,0,0,0,114,141,0,0,0,114,65,0, 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, - 0,114,236,0,0,0,136,4,0,0,115,6,0,0,0,6, + 0,114,236,0,0,0,137,4,0,0,115,6,0,0,0,6, 1,10,1,255,128,122,28,69,120,116,101,110,115,105,111,110, 70,105,108,101,76,111,97,100,101,114,46,95,95,105,110,105, 116,95,95,99,2,0,0,0,0,0,0,0,0,0,0,0, 2,0,0,0,2,0,0,0,67,0,0,0,114,12,1,0, 0,114,69,0,0,0,114,13,1,0,0,114,15,1,0,0, 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,114, - 16,1,0,0,140,4,0,0,114,17,1,0,0,122,26,69, + 16,1,0,0,141,4,0,0,114,17,1,0,0,122,26,69, 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, 101,114,46,95,95,101,113,95,95,99,1,0,0,0,0,0, 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, 0,0,114,18,1,0,0,114,69,0,0,0,114,19,1,0, 0,114,21,1,0,0,114,7,0,0,0,114,7,0,0,0, - 114,8,0,0,0,114,22,1,0,0,144,4,0,0,114,23, + 114,8,0,0,0,114,22,1,0,0,145,4,0,0,114,23, 1,0,0,122,28,69,120,116,101,110,115,105,111,110,70,105, 108,101,76,111,97,100,101,114,46,95,95,104,97,115,104,95, 95,99,2,0,0,0,0,0,0,0,0,0,0,0,3,0, @@ -1775,7 +1775,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 100,121,110,97,109,105,99,114,173,0,0,0,114,141,0,0, 0,114,65,0,0,0,41,3,114,143,0,0,0,114,210,0, 0,0,114,244,0,0,0,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,239,0,0,0,147,4,0,0,115, + 0,114,8,0,0,0,114,239,0,0,0,148,4,0,0,115, 16,0,0,0,4,2,6,1,4,255,6,2,8,1,4,255, 4,2,255,128,122,33,69,120,116,101,110,115,105,111,110,70, 105,108,101,76,111,97,100,101,114,46,99,114,101,97,116,101, @@ -1793,7 +1793,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 110,97,109,105,99,114,173,0,0,0,114,141,0,0,0,114, 65,0,0,0,169,2,114,143,0,0,0,114,244,0,0,0, 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,114, - 245,0,0,0,155,4,0,0,115,10,0,0,0,14,2,6, + 245,0,0,0,156,4,0,0,115,10,0,0,0,14,2,6, 1,8,1,8,255,255,128,122,31,69,120,116,101,110,115,105, 111,110,70,105,108,101,76,111,97,100,101,114,46,101,120,101, 99,95,109,111,100,117,108,101,99,2,0,0,0,0,0,0, @@ -1811,14 +1811,14 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 114,236,0,0,0,78,114,7,0,0,0,169,2,114,5,0, 0,0,218,6,115,117,102,102,105,120,169,1,90,9,102,105, 108,101,95,110,97,109,101,114,7,0,0,0,114,8,0,0, - 0,114,9,0,0,0,164,4,0,0,115,8,0,0,0,6, + 0,114,9,0,0,0,165,4,0,0,115,8,0,0,0,6, 128,2,1,20,255,255,128,122,49,69,120,116,101,110,115,105, 111,110,70,105,108,101,76,111,97,100,101,114,46,105,115,95, 112,97,99,107,97,103,101,46,60,108,111,99,97,108,115,62, 46,60,103,101,110,101,120,112,114,62,78,41,4,114,74,0, 0,0,114,65,0,0,0,218,3,97,110,121,114,232,0,0, 0,114,247,0,0,0,114,7,0,0,0,114,45,1,0,0, - 114,8,0,0,0,114,206,0,0,0,161,4,0,0,115,10, + 114,8,0,0,0,114,206,0,0,0,162,4,0,0,115,10, 0,0,0,14,2,12,1,2,1,8,255,255,128,122,30,69, 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, 101,114,46,105,115,95,112,97,99,107,97,103,101,99,2,0, @@ -1829,7 +1829,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 101,32,99,97,110,110,111,116,32,99,114,101,97,116,101,32, 97,32,99,111,100,101,32,111,98,106,101,99,116,46,78,114, 7,0,0,0,114,247,0,0,0,114,7,0,0,0,114,7, - 0,0,0,114,8,0,0,0,114,241,0,0,0,167,4,0, + 0,0,0,114,8,0,0,0,114,241,0,0,0,168,4,0, 0,114,24,0,0,0,122,28,69,120,116,101,110,115,105,111, 110,70,105,108,101,76,111,97,100,101,114,46,103,101,116,95, 99,111,100,101,99,2,0,0,0,0,0,0,0,0,0,0, @@ -1839,14 +1839,14 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 111,100,117,108,101,115,32,104,97,118,101,32,110,111,32,115, 111,117,114,99,101,32,99,111,100,101,46,78,114,7,0,0, 0,114,247,0,0,0,114,7,0,0,0,114,7,0,0,0, - 114,8,0,0,0,114,1,1,0,0,171,4,0,0,114,24, + 114,8,0,0,0,114,1,1,0,0,172,4,0,0,114,24, 0,0,0,122,30,69,120,116,101,110,115,105,111,110,70,105, 108,101,76,111,97,100,101,114,46,103,101,116,95,115,111,117, 114,99,101,99,2,0,0,0,0,0,0,0,0,0,0,0, 2,0,0,0,1,0,0,0,67,0,0,0,114,26,1,0, 0,114,27,1,0,0,114,71,0,0,0,114,247,0,0,0, 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,114, - 203,0,0,0,175,4,0,0,114,28,1,0,0,122,32,69, + 203,0,0,0,176,4,0,0,114,28,1,0,0,122,32,69, 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, 101,114,46,103,101,116,95,102,105,108,101,110,97,109,101,78, 41,14,114,150,0,0,0,114,149,0,0,0,114,151,0,0, @@ -1855,7 +1855,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 206,0,0,0,114,241,0,0,0,114,1,1,0,0,114,160, 0,0,0,114,203,0,0,0,114,7,0,0,0,114,7,0, 0,0,114,7,0,0,0,114,8,0,0,0,114,30,1,0, - 0,128,4,0,0,115,26,0,0,0,8,0,4,2,8,6, + 0,129,4,0,0,115,26,0,0,0,8,0,4,2,8,6, 8,4,8,4,8,3,8,8,8,6,8,6,8,4,2,4, 14,1,255,128,114,30,1,0,0,99,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, @@ -1897,7 +1897,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 112,97,116,104,95,102,105,110,100,101,114,169,4,114,143,0, 0,0,114,141,0,0,0,114,65,0,0,0,90,11,112,97, 116,104,95,102,105,110,100,101,114,114,7,0,0,0,114,7, - 0,0,0,114,8,0,0,0,114,236,0,0,0,188,4,0, + 0,0,0,114,8,0,0,0,114,236,0,0,0,189,4,0, 0,115,10,0,0,0,6,1,6,1,14,1,10,1,255,128, 122,23,95,78,97,109,101,115,112,97,99,101,80,97,116,104, 46,95,95,105,110,105,116,95,95,99,1,0,0,0,0,0, @@ -1915,7 +1915,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,114,40,1,0,0,218,3,100,111,116,90,2,109, 101,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, 218,23,95,102,105,110,100,95,112,97,114,101,110,116,95,112, - 97,116,104,95,110,97,109,101,115,194,4,0,0,115,10,0, + 97,116,104,95,110,97,109,101,115,195,4,0,0,115,10,0, 0,0,18,2,8,1,4,2,8,3,255,128,122,38,95,78, 97,109,101,115,112,97,99,101,80,97,116,104,46,95,102,105, 110,100,95,112,97,114,101,110,116,95,112,97,116,104,95,110, @@ -1928,7 +1928,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 143,0,0,0,90,18,112,97,114,101,110,116,95,109,111,100, 117,108,101,95,110,97,109,101,90,14,112,97,116,104,95,97, 116,116,114,95,110,97,109,101,114,7,0,0,0,114,7,0, - 0,0,114,8,0,0,0,114,50,1,0,0,204,4,0,0, + 0,0,114,8,0,0,0,114,50,1,0,0,205,4,0,0, 115,6,0,0,0,12,1,16,1,255,128,122,31,95,78,97, 109,101,115,112,97,99,101,80,97,116,104,46,95,103,101,116, 95,112,97,114,101,110,116,95,112,97,116,104,99,1,0,0, @@ -1944,7 +1944,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 202,0,0,0,114,49,1,0,0,41,3,114,143,0,0,0, 90,11,112,97,114,101,110,116,95,112,97,116,104,114,210,0, 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, - 0,218,12,95,114,101,99,97,108,99,117,108,97,116,101,208, + 0,218,12,95,114,101,99,97,108,99,117,108,97,116,101,209, 4,0,0,115,18,0,0,0,12,2,10,1,14,1,18,3, 6,1,8,1,6,1,6,1,255,128,122,27,95,78,97,109, 101,115,112,97,99,101,80,97,116,104,46,95,114,101,99,97, @@ -1954,7 +1954,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,114,69,0,0,0,41,2,218,4,105,116,101,114,114,57, 1,0,0,114,21,1,0,0,114,7,0,0,0,114,7,0, 0,0,114,8,0,0,0,218,8,95,95,105,116,101,114,95, - 95,221,4,0,0,243,4,0,0,0,12,1,255,128,122,23, + 95,222,4,0,0,243,4,0,0,0,12,1,255,128,122,23, 95,78,97,109,101,115,112,97,99,101,80,97,116,104,46,95, 95,105,116,101,114,95,95,99,2,0,0,0,0,0,0,0, 0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,0, @@ -1962,7 +1962,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,114,69,0,0,0,169,1,114,57,1,0,0,41,2,114, 143,0,0,0,218,5,105,110,100,101,120,114,7,0,0,0, 114,7,0,0,0,114,8,0,0,0,218,11,95,95,103,101, - 116,105,116,101,109,95,95,224,4,0,0,114,61,1,0,0, + 116,105,116,101,109,95,95,225,4,0,0,114,61,1,0,0, 122,26,95,78,97,109,101,115,112,97,99,101,80,97,116,104, 46,95,95,103,101,116,105,116,101,109,95,95,99,3,0,0, 0,0,0,0,0,0,0,0,0,3,0,0,0,3,0,0, @@ -1971,14 +1971,14 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 49,1,0,0,41,3,114,143,0,0,0,114,63,1,0,0, 114,65,0,0,0,114,7,0,0,0,114,7,0,0,0,114, 8,0,0,0,218,11,95,95,115,101,116,105,116,101,109,95, - 95,227,4,0,0,115,4,0,0,0,14,1,255,128,122,26, + 95,228,4,0,0,115,4,0,0,0,14,1,255,128,122,26, 95,78,97,109,101,115,112,97,99,101,80,97,116,104,46,95, 95,115,101,116,105,116,101,109,95,95,99,1,0,0,0,0, 0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,67, 0,0,0,114,58,1,0,0,114,69,0,0,0,41,2,114, 4,0,0,0,114,57,1,0,0,114,21,1,0,0,114,7, 0,0,0,114,7,0,0,0,114,8,0,0,0,218,7,95, - 95,108,101,110,95,95,230,4,0,0,114,61,1,0,0,122, + 95,108,101,110,95,95,231,4,0,0,114,61,1,0,0,122, 22,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, 95,95,108,101,110,95,95,99,1,0,0,0,0,0,0,0, 0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,0, @@ -1987,7 +1987,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 80,97,116,104,40,123,33,114,125,41,41,2,114,89,0,0, 0,114,49,1,0,0,114,21,1,0,0,114,7,0,0,0, 114,7,0,0,0,114,8,0,0,0,218,8,95,95,114,101, - 112,114,95,95,233,4,0,0,114,61,1,0,0,122,23,95, + 112,114,95,95,234,4,0,0,114,61,1,0,0,122,23,95, 78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,95, 114,101,112,114,95,95,99,2,0,0,0,0,0,0,0,0, 0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115, @@ -1995,7 +1995,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 114,69,0,0,0,114,62,1,0,0,169,2,114,143,0,0, 0,218,4,105,116,101,109,114,7,0,0,0,114,7,0,0, 0,114,8,0,0,0,218,12,95,95,99,111,110,116,97,105, - 110,115,95,95,236,4,0,0,114,61,1,0,0,122,27,95, + 110,115,95,95,237,4,0,0,114,61,1,0,0,122,27,95, 78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,95, 99,111,110,116,97,105,110,115,95,95,99,2,0,0,0,0, 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,67, @@ -2003,7 +2003,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 161,1,1,0,100,0,83,0,114,69,0,0,0,41,2,114, 49,1,0,0,114,61,0,0,0,114,69,1,0,0,114,7, 0,0,0,114,7,0,0,0,114,8,0,0,0,114,61,0, - 0,0,239,4,0,0,243,4,0,0,0,16,1,255,128,122, + 0,0,240,4,0,0,243,4,0,0,0,16,1,255,128,122, 21,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46, 97,112,112,101,110,100,78,41,15,114,150,0,0,0,114,149, 0,0,0,114,151,0,0,0,114,152,0,0,0,114,236,0, @@ -2011,7 +2011,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,114,60,1,0,0,114,64,1,0,0,114,65,1,0,0, 114,66,1,0,0,114,68,1,0,0,114,71,1,0,0,114, 61,0,0,0,114,7,0,0,0,114,7,0,0,0,114,7, - 0,0,0,114,8,0,0,0,114,47,1,0,0,181,4,0, + 0,0,0,114,8,0,0,0,114,47,1,0,0,182,4,0, 0,115,28,0,0,0,8,0,4,1,8,6,8,6,8,10, 8,4,8,13,8,3,8,3,8,3,8,3,8,3,12,3, 255,128,114,47,1,0,0,99,0,0,0,0,0,0,0,0, @@ -2028,7 +2028,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,124,1,124,2,124,3,131,3,124,0,95,1,100,0,83, 0,114,69,0,0,0,41,2,114,47,1,0,0,114,49,1, 0,0,114,53,1,0,0,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,236,0,0,0,245,4,0,0,115, + 0,114,8,0,0,0,114,236,0,0,0,246,4,0,0,115, 4,0,0,0,18,1,255,128,122,25,95,78,97,109,101,115, 112,97,99,101,76,111,97,100,101,114,46,95,95,105,110,105, 116,95,95,99,1,0,0,0,0,0,0,0,0,0,0,0, @@ -2052,21 +2052,21 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 41,5,114,99,0,0,0,114,100,0,0,0,114,101,0,0, 0,114,89,0,0,0,114,150,0,0,0,41,1,114,244,0, 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, - 0,218,11,109,111,100,117,108,101,95,114,101,112,114,248,4, + 0,218,11,109,111,100,117,108,101,95,114,101,112,114,249,4, 0,0,115,10,0,0,0,6,7,2,1,4,255,12,2,255, 128,122,28,95,78,97,109,101,115,112,97,99,101,76,111,97, 100,101,114,46,109,111,100,117,108,101,95,114,101,112,114,99, 2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, 1,0,0,0,67,0,0,0,114,23,0,0,0,41,2,78, 84,114,7,0,0,0,114,247,0,0,0,114,7,0,0,0, - 114,7,0,0,0,114,8,0,0,0,114,206,0,0,0,3, + 114,7,0,0,0,114,8,0,0,0,114,206,0,0,0,4, 5,0,0,243,4,0,0,0,4,1,255,128,122,27,95,78, 97,109,101,115,112,97,99,101,76,111,97,100,101,114,46,105, 115,95,112,97,99,107,97,103,101,99,2,0,0,0,0,0, 0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0, 0,0,114,23,0,0,0,41,2,78,114,10,0,0,0,114, 7,0,0,0,114,247,0,0,0,114,7,0,0,0,114,7, - 0,0,0,114,8,0,0,0,114,1,1,0,0,6,5,0, + 0,0,0,114,8,0,0,0,114,1,1,0,0,7,5,0, 0,114,75,1,0,0,122,27,95,78,97,109,101,115,112,97, 99,101,76,111,97,100,101,114,46,103,101,116,95,115,111,117, 114,99,101,99,2,0,0,0,0,0,0,0,0,0,0,0, @@ -2076,20 +2076,20 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 110,103,62,114,243,0,0,0,84,41,1,114,3,1,0,0, 41,1,114,4,1,0,0,114,247,0,0,0,114,7,0,0, 0,114,7,0,0,0,114,8,0,0,0,114,241,0,0,0, - 9,5,0,0,114,72,1,0,0,122,25,95,78,97,109,101, + 10,5,0,0,114,72,1,0,0,122,25,95,78,97,109,101, 115,112,97,99,101,76,111,97,100,101,114,46,103,101,116,95, 99,111,100,101,99,2,0,0,0,0,0,0,0,0,0,0, 0,2,0,0,0,1,0,0,0,67,0,0,0,114,23,0, 0,0,114,237,0,0,0,114,7,0,0,0,114,238,0,0, 0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, - 114,239,0,0,0,12,5,0,0,114,240,0,0,0,122,30, + 114,239,0,0,0,13,5,0,0,114,240,0,0,0,122,30, 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, 46,99,114,101,97,116,101,95,109,111,100,117,108,101,99,2, 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1, 0,0,0,67,0,0,0,115,4,0,0,0,100,0,83,0, 114,69,0,0,0,114,7,0,0,0,114,42,1,0,0,114, 7,0,0,0,114,7,0,0,0,114,8,0,0,0,114,245, - 0,0,0,15,5,0,0,114,75,1,0,0,122,28,95,78, + 0,0,0,16,5,0,0,114,75,1,0,0,122,28,95,78, 97,109,101,115,112,97,99,101,76,111,97,100,101,114,46,101, 120,101,99,95,109,111,100,117,108,101,99,2,0,0,0,0, 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,67, @@ -2107,7 +2107,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 78,41,4,114,159,0,0,0,114,173,0,0,0,114,49,1, 0,0,114,246,0,0,0,114,247,0,0,0,114,7,0,0, 0,114,7,0,0,0,114,8,0,0,0,114,248,0,0,0, - 18,5,0,0,115,10,0,0,0,6,7,4,1,4,255,12, + 19,5,0,0,115,10,0,0,0,6,7,4,1,4,255,12, 3,255,128,122,28,95,78,97,109,101,115,112,97,99,101,76, 111,97,100,101,114,46,108,111,97,100,95,109,111,100,117,108, 101,99,2,0,0,0,0,0,0,0,0,0,0,0,3,0, @@ -2118,7 +2118,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 41,3,114,32,1,0,0,114,76,1,0,0,114,49,1,0, 0,41,3,114,143,0,0,0,114,244,0,0,0,114,76,1, 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, - 0,114,33,1,0,0,30,5,0,0,115,6,0,0,0,12, + 0,114,33,1,0,0,31,5,0,0,115,6,0,0,0,12, 1,10,1,255,128,122,36,95,78,97,109,101,115,112,97,99, 101,76,111,97,100,101,114,46,103,101,116,95,114,101,115,111, 117,114,99,101,95,114,101,97,100,101,114,78,41,13,114,150, @@ -2127,7 +2127,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,114,1,1,0,0,114,241,0,0,0,114,239,0,0,0, 114,245,0,0,0,114,248,0,0,0,114,33,1,0,0,114, 7,0,0,0,114,7,0,0,0,114,7,0,0,0,114,8, - 0,0,0,114,73,1,0,0,244,4,0,0,115,24,0,0, + 0,0,0,114,73,1,0,0,245,4,0,0,115,24,0,0, 0,8,0,8,1,2,3,10,1,8,10,8,3,8,3,8, 3,8,3,8,3,12,12,255,128,114,73,1,0,0,99,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, @@ -2164,7 +2164,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 99,97,99,104,101,218,5,105,116,101,109,115,114,153,0,0, 0,114,78,1,0,0,41,2,114,141,0,0,0,218,6,102, 105,110,100,101,114,114,7,0,0,0,114,7,0,0,0,114, - 8,0,0,0,114,78,1,0,0,41,5,0,0,115,16,0, + 8,0,0,0,114,78,1,0,0,42,5,0,0,115,16,0, 0,0,22,4,8,1,10,1,10,1,8,1,2,128,4,252, 255,128,122,28,80,97,116,104,70,105,110,100,101,114,46,105, 110,118,97,108,105,100,97,116,101,95,99,97,99,104,101,115, @@ -2184,7 +2184,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,114,162,0,0,0,114,142,0,0,0,41,2,114, 65,0,0,0,90,4,104,111,111,107,114,7,0,0,0,114, 7,0,0,0,114,8,0,0,0,218,11,95,112,97,116,104, - 95,104,111,111,107,115,51,5,0,0,115,20,0,0,0,16, + 95,104,111,111,107,115,52,5,0,0,115,20,0,0,0,16, 3,12,1,10,1,2,1,14,1,12,1,4,1,4,2,2, 253,255,128,122,22,80,97,116,104,70,105,110,100,101,114,46, 95,112,97,116,104,95,104,111,111,107,115,99,2,0,0,0, @@ -2216,7 +2216,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,41,3,114,221,0,0,0,114,65,0,0,0,114,82,1, 0,0,114,7,0,0,0,114,7,0,0,0,114,8,0,0, 0,218,20,95,112,97,116,104,95,105,109,112,111,114,116,101, - 114,95,99,97,99,104,101,64,5,0,0,115,30,0,0,0, + 114,95,99,97,99,104,101,65,5,0,0,115,30,0,0,0, 8,8,2,1,12,1,12,1,6,3,2,1,12,1,4,4, 12,253,10,1,12,1,4,1,2,253,2,250,255,128,122,31, 80,97,116,104,70,105,110,100,101,114,46,95,112,97,116,104, @@ -2247,7 +2247,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 114,166,0,0,0,114,164,0,0,0,114,165,0,0,0,114, 210,0,0,0,114,7,0,0,0,114,7,0,0,0,114,8, 0,0,0,218,16,95,108,101,103,97,99,121,95,103,101,116, - 95,115,112,101,99,86,5,0,0,115,28,0,0,0,10,4, + 95,115,112,101,99,87,5,0,0,115,28,0,0,0,10,4, 16,1,12,2,16,1,16,2,12,2,10,1,4,1,8,1, 12,1,12,1,6,1,4,1,255,128,122,27,80,97,116,104, 70,105,110,100,101,114,46,95,108,101,103,97,99,121,95,103, @@ -2279,7 +2279,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 95,112,97,116,104,90,5,101,110,116,114,121,114,82,1,0, 0,114,210,0,0,0,114,165,0,0,0,114,7,0,0,0, 114,7,0,0,0,114,8,0,0,0,218,9,95,103,101,116, - 95,115,112,101,99,107,5,0,0,115,44,0,0,0,4,5, + 95,115,112,101,99,108,5,0,0,115,44,0,0,0,4,5, 8,1,14,1,2,1,10,1,8,1,10,1,14,1,12,2, 8,1,2,1,10,1,8,1,6,1,8,1,8,1,10,5, 2,128,12,2,6,1,4,1,255,128,122,20,80,97,116,104, @@ -2306,7 +2306,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 1,0,0,41,6,114,221,0,0,0,114,163,0,0,0,114, 65,0,0,0,114,225,0,0,0,114,210,0,0,0,114,90, 1,0,0,114,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,114,226,0,0,0,139,5,0,0,115,28,0,0,0, + 0,0,114,226,0,0,0,140,5,0,0,115,28,0,0,0, 8,6,6,1,14,1,8,1,4,1,10,1,6,1,4,1, 6,3,16,1,4,1,4,2,4,2,255,128,122,20,80,97, 116,104,70,105,110,100,101,114,46,102,105,110,100,95,115,112, @@ -2333,7 +2333,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 110,32,51,46,49,50,59,32,117,115,101,32,102,105,110,100, 95,115,112,101,99,40,41,32,105,110,115,116,101,97,100,78, 114,227,0,0,0,114,228,0,0,0,114,7,0,0,0,114, - 7,0,0,0,114,8,0,0,0,114,229,0,0,0,163,5, + 7,0,0,0,114,8,0,0,0,114,229,0,0,0,164,5, 0,0,115,16,0,0,0,6,8,2,2,4,254,12,3,8, 1,4,1,6,1,255,128,122,22,80,97,116,104,70,105,110, 100,101,114,46,102,105,110,100,95,109,111,100,117,108,101,99, @@ -2366,7 +2366,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 115,116,114,105,98,117,116,105,111,110,115,41,3,114,144,0, 0,0,114,145,0,0,0,114,92,1,0,0,114,7,0,0, 0,114,7,0,0,0,114,8,0,0,0,114,93,1,0,0, - 179,5,0,0,115,6,0,0,0,12,10,16,1,255,128,122, + 180,5,0,0,115,6,0,0,0,12,10,16,1,255,128,122, 29,80,97,116,104,70,105,110,100,101,114,46,102,105,110,100, 95,100,105,115,116,114,105,98,117,116,105,111,110,115,114,69, 0,0,0,114,230,0,0,0,41,14,114,150,0,0,0,114, @@ -2375,7 +2375,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,114,87,1,0,0,114,88,1,0,0,114,91,1,0, 0,114,226,0,0,0,114,229,0,0,0,114,93,1,0,0, 114,7,0,0,0,114,7,0,0,0,114,7,0,0,0,114, - 8,0,0,0,114,77,1,0,0,37,5,0,0,115,38,0, + 8,0,0,0,114,77,1,0,0,38,5,0,0,115,38,0, 0,0,8,0,4,2,2,2,10,1,2,9,10,1,2,12, 10,1,2,21,10,1,2,20,12,1,2,31,12,1,2,23, 12,1,2,15,14,1,255,128,114,77,1,0,0,99,0,0, @@ -2422,7 +2422,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 7,125,1,124,1,136,0,102,2,86,0,1,0,113,2,100, 0,83,0,114,69,0,0,0,114,7,0,0,0,114,43,1, 0,0,169,1,114,164,0,0,0,114,7,0,0,0,114,8, - 0,0,0,114,9,0,0,0,208,5,0,0,115,6,0,0, + 0,0,0,114,9,0,0,0,209,5,0,0,115,6,0,0, 0,6,128,18,0,255,128,122,38,70,105,108,101,70,105,110, 100,101,114,46,95,95,105,110,105,116,95,95,46,60,108,111, 99,97,108,115,62,46,60,103,101,110,101,120,112,114,62,114, @@ -2436,7 +2436,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 65,0,0,0,218,14,108,111,97,100,101,114,95,100,101,116, 97,105,108,115,90,7,108,111,97,100,101,114,115,114,212,0, 0,0,114,7,0,0,0,114,95,1,0,0,114,8,0,0, - 0,114,236,0,0,0,202,5,0,0,115,22,0,0,0,4, + 0,114,236,0,0,0,203,5,0,0,115,22,0,0,0,4, 4,12,1,26,1,6,1,10,2,10,1,18,1,6,1,8, 1,12,1,255,128,122,19,70,105,108,101,70,105,110,100,101, 114,46,95,95,105,110,105,116,95,95,99,1,0,0,0,0, @@ -2446,7 +2446,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 32,116,104,101,32,100,105,114,101,99,116,111,114,121,32,109, 116,105,109,101,46,114,130,0,0,0,78,41,1,114,97,1, 0,0,114,21,1,0,0,114,7,0,0,0,114,7,0,0, - 0,114,8,0,0,0,114,78,1,0,0,218,5,0,0,114, + 0,114,8,0,0,0,114,78,1,0,0,219,5,0,0,114, 81,0,0,0,122,28,70,105,108,101,70,105,110,100,101,114, 46,105,110,118,97,108,105,100,97,116,101,95,99,97,99,104, 101,115,99,2,0,0,0,0,0,0,0,0,0,0,0,3, @@ -2477,7 +2477,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,114,101,0,0,0,114,226,0,0,0,114,164,0, 0,0,114,202,0,0,0,41,3,114,143,0,0,0,114,163, 0,0,0,114,210,0,0,0,114,7,0,0,0,114,7,0, - 0,0,114,8,0,0,0,114,161,0,0,0,224,5,0,0, + 0,0,114,8,0,0,0,114,161,0,0,0,225,5,0,0, 115,16,0,0,0,6,7,2,2,4,254,10,3,8,1,8, 1,16,1,255,128,122,22,70,105,108,101,70,105,110,100,101, 114,46,102,105,110,100,95,108,111,97,100,101,114,99,6,0, @@ -2488,7 +2488,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 213,0,0,0,41,7,114,143,0,0,0,114,211,0,0,0, 114,163,0,0,0,114,65,0,0,0,90,4,115,109,115,108, 114,225,0,0,0,114,164,0,0,0,114,7,0,0,0,114, - 7,0,0,0,114,8,0,0,0,114,91,1,0,0,239,5, + 7,0,0,0,114,8,0,0,0,114,91,1,0,0,240,5, 0,0,115,10,0,0,0,10,1,8,1,2,1,6,255,255, 128,122,20,70,105,108,101,70,105,110,100,101,114,46,95,103, 101,116,95,115,112,101,99,78,99,3,0,0,0,0,0,0, @@ -2545,7 +2545,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,90,13,105,110,105,116,95,102,105,108,101,110,97,109, 101,90,9,102,117,108,108,95,112,97,116,104,114,210,0,0, 0,114,7,0,0,0,114,7,0,0,0,114,8,0,0,0, - 114,226,0,0,0,244,5,0,0,115,88,0,0,0,4,5, + 114,226,0,0,0,245,5,0,0,115,88,0,0,0,4,5, 14,1,2,1,24,1,12,1,6,1,10,1,8,1,6,1, 6,2,6,1,10,1,6,2,4,1,8,2,12,1,14,1, 8,1,10,1,8,1,24,1,2,255,8,5,14,2,2,1, @@ -2577,7 +2577,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,93,6,125,1,124,1,160,0,161,0,146,2,113,2,83, 0,114,7,0,0,0,41,1,114,131,0,0,0,41,2,114, 5,0,0,0,90,2,102,110,114,7,0,0,0,114,7,0, - 0,0,114,8,0,0,0,114,13,0,0,0,68,6,0,0, + 0,0,114,8,0,0,0,114,13,0,0,0,69,6,0,0, 115,4,0,0,0,20,0,255,128,122,41,70,105,108,101,70, 105,110,100,101,114,46,95,102,105,108,108,95,99,97,99,104, 101,46,60,108,111,99,97,108,115,62,46,60,115,101,116,99, @@ -2594,7 +2594,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 102,102,105,120,95,99,111,110,116,101,110,116,115,114,70,1, 0,0,114,141,0,0,0,114,54,1,0,0,114,44,1,0, 0,90,8,110,101,119,95,110,97,109,101,114,7,0,0,0, - 114,7,0,0,0,114,8,0,0,0,114,102,1,0,0,39, + 114,7,0,0,0,114,8,0,0,0,114,102,1,0,0,40, 6,0,0,115,40,0,0,0,6,2,2,1,22,1,18,1, 6,3,12,3,12,1,6,7,8,1,16,1,4,1,18,1, 4,2,12,1,6,1,12,1,20,1,4,255,2,233,255,128, @@ -2633,7 +2633,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,0,0,114,142,0,0,0,114,71,0,0,0,169,2,114, 221,0,0,0,114,101,1,0,0,114,7,0,0,0,114,8, 0,0,0,218,24,112,97,116,104,95,104,111,111,107,95,102, - 111,114,95,70,105,108,101,70,105,110,100,101,114,80,6,0, + 111,114,95,70,105,108,101,70,105,110,100,101,114,81,6,0, 0,115,8,0,0,0,8,2,12,1,16,1,255,128,122,54, 70,105,108,101,70,105,110,100,101,114,46,112,97,116,104,95, 104,111,111,107,46,60,108,111,99,97,108,115,62,46,112,97, @@ -2641,7 +2641,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 70,105,110,100,101,114,78,114,7,0,0,0,41,3,114,221, 0,0,0,114,101,1,0,0,114,107,1,0,0,114,7,0, 0,0,114,106,1,0,0,114,8,0,0,0,218,9,112,97, - 116,104,95,104,111,111,107,70,6,0,0,115,6,0,0,0, + 116,104,95,104,111,111,107,71,6,0,0,115,6,0,0,0, 14,10,4,6,255,128,122,20,70,105,108,101,70,105,110,100, 101,114,46,112,97,116,104,95,104,111,111,107,99,1,0,0, 0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0, @@ -2649,7 +2649,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 105,108,101,70,105,110,100,101,114,40,123,33,114,125,41,41, 2,114,89,0,0,0,114,65,0,0,0,114,21,1,0,0, 114,7,0,0,0,114,7,0,0,0,114,8,0,0,0,114, - 68,1,0,0,88,6,0,0,114,61,1,0,0,122,19,70, + 68,1,0,0,89,6,0,0,114,61,1,0,0,122,19,70, 105,108,101,70,105,110,100,101,114,46,95,95,114,101,112,114, 95,95,114,69,0,0,0,41,15,114,150,0,0,0,114,149, 0,0,0,114,151,0,0,0,114,152,0,0,0,114,236,0, @@ -2657,7 +2657,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,114,161,0,0,0,114,91,1,0,0,114,226,0,0,0, 114,102,1,0,0,114,234,0,0,0,114,108,1,0,0,114, 68,1,0,0,114,7,0,0,0,114,7,0,0,0,114,7, - 0,0,0,114,8,0,0,0,114,94,1,0,0,193,5,0, + 0,0,0,114,8,0,0,0,114,94,1,0,0,194,5,0, 0,115,26,0,0,0,8,0,4,2,8,7,8,16,4,4, 8,2,8,15,10,5,8,51,2,31,10,1,12,17,255,128, 114,94,1,0,0,99,4,0,0,0,0,0,0,0,0,0, @@ -2681,7 +2681,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 109,101,90,9,99,112,97,116,104,110,97,109,101,114,164,0, 0,0,114,210,0,0,0,114,7,0,0,0,114,7,0,0, 0,114,8,0,0,0,218,14,95,102,105,120,95,117,112,95, - 109,111,100,117,108,101,94,6,0,0,115,38,0,0,0,10, + 109,111,100,117,108,101,95,6,0,0,115,38,0,0,0,10, 2,10,1,4,1,4,1,8,1,8,1,12,1,10,2,4, 1,14,1,2,1,8,1,8,1,8,1,14,1,12,1,6, 2,2,254,255,128,114,113,1,0,0,99,0,0,0,0,0, @@ -2701,7 +2701,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 0,114,113,0,0,0,41,3,90,10,101,120,116,101,110,115, 105,111,110,115,90,6,115,111,117,114,99,101,90,8,98,121, 116,101,99,111,100,101,114,7,0,0,0,114,7,0,0,0, - 114,8,0,0,0,114,208,0,0,0,117,6,0,0,115,10, + 114,8,0,0,0,114,208,0,0,0,118,6,0,0,115,10, 0,0,0,12,5,8,1,8,1,10,1,255,128,114,208,0, 0,0,99,1,0,0,0,0,0,0,0,0,0,0,0,1, 0,0,0,1,0,0,0,67,0,0,0,115,8,0,0,0, @@ -2709,7 +2709,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 159,0,0,0,41,1,218,17,95,98,111,111,116,115,116,114, 97,112,95,109,111,100,117,108,101,114,7,0,0,0,114,7, 0,0,0,114,8,0,0,0,218,21,95,115,101,116,95,98, - 111,111,116,115,116,114,97,112,95,109,111,100,117,108,101,128, + 111,111,116,115,116,114,97,112,95,109,111,100,117,108,101,129, 6,0,0,115,4,0,0,0,8,2,255,128,114,116,1,0, 0,99,1,0,0,0,0,0,0,0,0,0,0,0,2,0, 0,0,4,0,0,0,67,0,0,0,115,50,0,0,0,116, @@ -2725,7 +2725,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 61,0,0,0,114,77,1,0,0,41,2,114,115,1,0,0, 90,17,115,117,112,112,111,114,116,101,100,95,108,111,97,100, 101,114,115,114,7,0,0,0,114,7,0,0,0,114,8,0, - 0,0,218,8,95,105,110,115,116,97,108,108,133,6,0,0, + 0,0,218,8,95,105,110,115,116,97,108,108,134,6,0,0, 115,10,0,0,0,8,2,6,1,20,1,16,1,255,128,114, 118,1,0,0,41,1,114,87,0,0,0,114,69,0,0,0, 41,3,78,78,78,41,2,114,0,0,0,0,114,0,0,0, @@ -2770,7 +2770,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 1,8,1,10,1,14,1,4,4,4,1,2,1,2,1,4, 255,8,4,6,16,8,3,8,5,8,5,4,6,10,1,8, 30,8,6,8,8,8,10,8,9,8,5,4,7,10,1,8, - 8,10,5,10,22,0,127,16,27,12,1,4,2,4,1,6, + 8,10,5,10,22,0,127,16,28,12,1,4,2,4,1,6, 2,4,1,10,1,8,2,6,2,8,2,16,2,8,71,8, 40,8,19,8,12,8,12,8,31,8,20,8,33,8,28,10, 24,10,13,10,10,8,11,6,14,4,3,2,1,12,255,14, diff --git a/Tools/peg_generator/pegen/grammar_parser.py b/Tools/peg_generator/pegen/grammar_parser.py index d94f01ad1a0..70fa5b001b5 100644 --- a/Tools/peg_generator/pegen/grammar_parser.py +++ b/Tools/peg_generator/pegen/grammar_parser.py @@ -2,7 +2,7 @@ # @generated by pegen from ./Tools/peg_generator/pegen/metagrammar.gram import ast -from typing import Optional +from typing import Optional, Any from pegen.parser import memoize, memoize_left_rec, logger, Parser from ast import literal_eval diff --git a/Tools/peg_generator/pegen/python_generator.py b/Tools/peg_generator/pegen/python_generator.py index 61827a6349b..b500e3e204a 100644 --- a/Tools/peg_generator/pegen/python_generator.py +++ b/Tools/peg_generator/pegen/python_generator.py @@ -27,7 +27,7 @@ MODULE_PREFIX = """\ # @generated by pegen from {filename} import ast -from typing import Optional +from typing import Optional, Any from pegen.parser import memoize, memoize_left_rec, logger, Parser