403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.145
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/__pycache__/test_unparse.cpython-313.opt-1.pyc
�

��iO{��J�SrSSKrSSKrSSKrSSKrSSKrSSKrSSKJ	r	 Sr
SrSrSr
SrS	rS
rSrSrS
rSrSrSrSrSr"SS\	\R25r"SS\5r"SS\5r"SS\R25r"SS\5r\S:Xa\R@"5 gg)zTests for ast.unparse.�N)�ASTTestMixinc��[R"U5nUR5sSSS5 $!,(df   g=f)zjRead and return the contents of a Python source file (as a
string), taking into account the file encoding.N)�tokenize�open�read)�filename�streams  �&C:\Python313\\Lib\test\test_unparse.py�read_pyfilers'��
���x�	 �F��{�{�}�
!�	 �	 �s�1�
?zQdef f():
    for x in range(10):
        break
    else:
        y = 2
    z = 3
zIdef g():
    while True:
        break
    else:
        y = 2
    z = 3
zQfrom . import fred
from .. import barney
from .australia import shrimp as prawns
zzdef f():
    x = 1
    def g():
        nonlocal x
        x = 2
        y = 7
        def h():
            nonlocal x, y
zOtry:
    1 / 0
except ZeroDivisionError as e:
    raise ArithmeticError from e
z@f1(arg)
@f2
class Foo: pass
z=if cond1:
    suite1
elif cond2:
    suite2
else:
    suite3
z,if cond1:
    suite1
elif cond2:
    suite2
zctry:
    suite1
except ex1:
    suite2
except ex2:
    suite3
else:
    suite4
finally:
    suite5
zetry:
    suite1
except* ex1:
    suite2
except* ex2:
    suite3
else:
    suite4
finally:
    suite5
zwith f():
    suite1
zwith f() as x:
    suite1
z$with f() as x, g() as y:
    suite1
)�zclass foo:
    zdef foo():
    zasync def foo():
    c�D�\rSrSrSr\4SjrS	SjrS	SjrS	Sjr	Sr
g)
�ASTTestCase�c��URXS9 [R"U40UD6n[R"U5n[R"U40UD6nUR	X55 SSS5 g!,(df   g=f)N)�code1�ast_parse_kwargs)�subTest�ast�parse�unparse�assertASTEqual)�selfr�kwargs�ast1�code2�ast2s      r
�check_ast_roundtrip�ASTTestCase.check_ast_roundtrip�s_��
�\�\��\�
?��9�9�U�-�f�-�D��K�K��%�E��9�9�U�-�f�-�D�����+�	@�
?�
?�s�AA/�/
A=c��URUS9 URU[RU5 SSS5 g!,(df   g=f)N)�node)r�assertRaisesrr)rr �raisess   r
�
check_invalid�ASTTestCase.check_invalid�s2��
�\�\�t�\�
$����f�c�k�k�4�8�%�
$�
$�s	�";�
A	Nc�r�U=(d Un[R"[R"U55nX4$�N)rrr�rrrs   r
�
get_source�ASTTestCase.get_source�s*���������C�I�I�e�,�-���|��c��URX5upURXS9 URX!5 SSS5 g!,(df   g=f�N)rr)r(r�assertEqualr's   r
�check_src_roundtrip�ASTTestCase.check_src_roundtrip�s:�����u�4���
�\�\��\�
3����U�*�4�
3�
3��	�>�
Ac��URX5upURXS9 URX!5 SSS5 g!,(df   g=fr,)r(r�assertNotEqualr's   r
�check_src_dont_roundtrip�$ASTTestCase.check_src_dont_roundtrip�s:�����u�4���
�\�\��\�
3�����-�4�
3�
3�r0�r&)�__name__�
__module__�__qualname__�__firstlineno__r�
ValueErrorr#r(r.r3�__static_attributes__r5r*r
rr�s ��,�*4�9��
+�
.r*rc�4�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#S"r$S#r%S$r&S%r'S&r(S'r)S(r*S)r+S*r,S+r-S,r.S-r/S.r0S/r1S0r2S1r3S2r4g3)4�UnparseTestCase�c�$�URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS	5 URS
5 URS5 URS5 URS
5 URS5 URS5 URS5 g)Nzf'a'zf'{{}}'zf'{{5}}'z	f'{{5}}5'z	f'X{{}}X'zf'{a}'zf'{ {1:2}}'zf'a{a}a'zf'a{a}{a}a'zf'a{a}a{a}a'zf'{a!r}x{a!s}12{{}}{a!a}'z	f'{a:10}'zf'{a:100_000{10}}'zf'{a!r:10}'z
f'{a:a{b}10}'zRf'a{b}{c!s}{d!r}{e!a}{f:a}{g:a{b}}{h!s:a}{j!s:{a}b}{k!s:a{b}c}{l!a:{b}c{d}}{x+y=}'�r�rs r
�
test_fstrings�UnparseTestCase.test_fstrings�s���� � ��(�� � ��+�� � ��,�� � ��-�� � ��-�� � ��*�� � ��/�� � ��,�� � ��/�� � ��0�� � �!<�=�� � ��-�� � �!5�6�� � ��/�� � ��1�� � �<�	
r*c��URS5 URS5 URS5 URS5 g)Nz
f'{f"{0}"*3}'z
f'{f"{y}"*3}'zf''zf"""'end' "quote\""""r@rAs r
�test_fstrings_special_chars�+UnparseTestCase.test_fstrings_special_chars�s=��� � �!5�6�� � �!5�6�� � ��+�� � �!=�>r*c���URS5 URS5 URS5 URS5 URS5 URS5 URS5 g)Nzf'''{"'"}'''�%f'''-{f"""*{f"+{f'.{x}.'}+"}*"""}-'''z4f'''-{f"""*{f"+{f'.{x}.'}+"}*"""}-'single quote\''''zf"""{'''
'''}"""zf"""{g('''
''')}"""z	f"a\r\nb"�f"\u2028{'x'}"r@rAs r
�test_fstrings_complicated�)UnparseTestCase.test_fstrings_complicated�sk��� � �!3�4�� � �!R�S�� � �!b�c�� � �!:�;�� � �!=�>�� � �!2�3�� � �!6�7r*c�H�URS5 URS5 g)Nz0f" something { my_dict["key"] } something else "z!f"{f"{f"{f"{f"{f"{1+1}"}"}"}"}"}"r@rAs r
�test_fstrings_pep701�$UnparseTestCase.test_fstrings_pep701�s ��� � �!S�T�� � �!D�Er*c�j�URS5 URS5 URS5 g)Nzu'foo'zr'foo'zb'foo'r@rAs r
�test_strings�UnparseTestCase.test_strings�s,��� � ��*�� � ��*�� � ��*r*c�&�URS5 g)Nzdel x, y, zr@rAs r
�test_del_statement�"UnparseTestCase.test_del_statement�s��� � ��/r*c�H�URS5 URS5 g)Nz45 << 2z13 >> 7r@rAs r
�test_shifts�UnparseTestCase.test_shifts�s��� � ��+�� � ��+r*c�.�UR[5 gr&)r�for_elserAs r
�
test_for_else�UnparseTestCase.test_for_else�s��� � ��*r*c�.�UR[5 gr&)r�
while_elserAs r
�test_while_else�UnparseTestCase.test_while_else����� � ��,r*c��URS5 URS5 URS5 URS5 URS5 g)Nz(-1)**7z(-1.)**8z(-1j)**6znot True or FalsezTrue or not Falser@rAs r
�test_unary_parens�!UnparseTestCase.test_unary_parens�sJ��� � ��+�� � ��,�� � ��,�� � �!4�5�� � �!4�5r*c�&�URS5 g)Nz3 .__abs__()r@rAs r
�test_integer_parens�#UnparseTestCase.test_integer_parens�s��� � ��0r*c��URS5 URS5 URS5 URS5 g)N�1e1000z-1e1000�1e1000jz-1e1000jr@rAs r
�test_huge_float�UnparseTestCase.test_huge_float�s:��� � ��*�� � ��+�� � ��+�� � ��,r*c���UR[R"[R"[R"[S5S955[R"S55 g)N�nan��valuez1e1000 - 1e1000)rrrr�Constant�floatrAs r
�test_nan�UnparseTestCase.test_nan�s?������I�I�c�k�k�#�,�,�U�5�\�"B�C�D��I�I�'�(�	
r*c�l�UR[S55 UR[S55 g)Ni�l����)r�strrAs r
�test_min_int�UnparseTestCase.test_min_int�s&��� � ��Z��1�� � ��Z��1r*c��URS5 URS5 URS5 URS5 g)N�7jz-7j�0jz-0jr@rAs r
�test_imaginary_literals�'UnparseTestCase.test_imaginary_literals�s:��� � ��&�� � ��'�� � ��&�� � ��'r*c�&�URS5 g)Nz(lambda: int)()r@rAs r
�test_lambda_parentheses�'UnparseTestCase.test_lambda_parentheses����� � �!2�3r*c�H�URS5 URS5 g)Nz
1 < 4 <= 5za is b is c is not dr@rAs r
�test_chained_comparisons�(UnparseTestCase.test_chained_comparisonss��� � ��.�� � �!7�8r*c��URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS	5 URS
5 URS5 URS5 g)
Nz
def f(): passzdef f(a): passzdef f(b = 2): passzdef f(a, b): passzdef f(a, b = 2): passzdef f(a = 5, b = 2): passzdef f(*, a = 1, b = 2): passzdef f(*, a = 1, b): passzdef f(*, a, b = 2): passz&def f(a, b = None, *, c, **kwds): passz'def f(a=2, *args, c=5, d, **kwds): passzdef f(*args, **kwargs): passr@rAs r
�test_function_arguments�'UnparseTestCase.test_function_argumentss���� � ��1�� � �!1�2�� � �!5�6�� � �!4�5�� � �!8�9�� � �!<�=�� � �!?�@�� � �!;�<�� � �!;�<�� � �!I�J�� � �!J�K�� � �!?�@r*c�.�UR[5 gr&)r�relative_importrAs r
�test_relative_import�$UnparseTestCase.test_relative_import���� � ��1r*c�.�UR[5 gr&)r�nonlocal_exrAs r
�
test_nonlocal�UnparseTestCase.test_nonlocal���� � ��-r*c�.�UR[5 gr&)r�
raise_fromrAs r
�test_raise_from�UnparseTestCase.test_raise_fromr`r*c�&�URS5 g)Nzb'123'r@rAs r
�
test_bytes�UnparseTestCase.test_bytess��� � ��*r*c��URS5 URS5 URS5 URS5 URS5 g)Nzdef f(a : int): passzdef f(a: int = 5): passzdef f(*args: [int]): passzdef f(**kwargs: dict): passzdef f() -> None: passr@rAs r
�test_annotations� UnparseTestCase.test_annotationssM��� � �!7�8�� � �!:�;�� � �!<�=�� � �!>�?�� � �!8�9r*c�&�URS5 g)Nz{'a', 'b', 'c'}r@rAs r
�test_set_literal� UnparseTestCase.test_set_literal&r�r*c
���UR[R"[R"[R"/S955[R"S55 g)N)�eltsz{*()})rrrr�SetrAs r
�test_empty_set�UnparseTestCase.test_empty_set)s:������I�I�c�k�k�#�'�'�r�"2�3�4��I�I�g��	
r*c�&�URS5 g)Nz{x for x in range(5)}r@rAs r
�test_set_comprehension�&UnparseTestCase.test_set_comprehension/s��� � �!8�9r*c�&�URS5 g)Nz{x: x*x for x in range(10)}r@rAs r
�test_dict_comprehension�'UnparseTestCase.test_dict_comprehension2s��� � �!>�?r*c�.�UR[5 gr&)r�class_decoratorrAs r
�test_class_decorators�%UnparseTestCase.test_class_decorators5r�r*c�&�URS5 g)Nz(class A(metaclass=type, *[], **{}): passr@rAs r
�test_class_definition�%UnparseTestCase.test_class_definition8s��� � �!K�Lr*c�X�UR[5 UR[5 gr&)r�elif1�elif2rAs r
�
test_elifs�UnparseTestCase.test_elifs;s��� � ��'�� � ��'r*c�.�UR[5 gr&)r�try_except_finallyrAs r
�test_try_except_finally�'UnparseTestCase.test_try_except_finally?s��� � �!3�4r*c�.�UR[5 gr&)r�try_except_star_finallyrAs r
�test_try_except_star_finally�,UnparseTestCase.test_try_except_star_finallyBs��� � �!8�9r*c��URS5 URS5 URS5 URS5 g)Nza, *b, c = seqza, (*b, c) = seqza, *b[0], c = seqza, *(b, c) = seqr@rAs r
�test_starred_assignment�'UnparseTestCase.test_starred_assignmentEs>��� � �!1�2�� � �!3�4�� � �!4�5�� � �!3�4r*c�.�UR[5 gr&)r�with_simplerAs r
�test_with_simple� UnparseTestCase.test_with_simpleKr�r*c�.�UR[5 gr&)r�with_asrAs r
�test_with_as�UnparseTestCase.test_with_asNs��� � ��)r*c�.�UR[5 gr&)r�with_two_itemsrAs r
�test_with_two_items�#UnparseTestCase.test_with_two_itemsQs��� � ��0r*c�H�URS5 URS5 g)Nz{**{'y': 2}, 'x': 1}z{**{'y': 2}, **{'x': 1}}r@rAs r
�test_dict_unpacking_in_dict�+UnparseTestCase.test_dict_unpacking_in_dictTs ��� � �!<�=�� � �!@�Ar*c�4�URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS	5 URS
5 URS5 URS5 URS
5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 g)Nza[i]za[i,]za[i, j]za[(*a,)]za[*a]za[b, *a]za[*a, c]za[b, *a, c]�	a[*a, *a]za[b, *a, *a]za[*a, b, *a]za[*a, *a, b]za[b, *a, *a, c]z	a[(a:=b)]za[(a:=b,c)]�a[()]za[i:j]za[:j]za[i:]za[i:j:k]za[:j:k]za[i::k]za[i:j,]z	a[i:j, k]r@rAs r
�test_slices�UnparseTestCase.test_slicesYsS��� � ��(�� � ��)�� � ��+�� � ��,�� � ��)�� � ��,�� � ��,�� � ��/�� � ��-�� � ��0�� � ��0�� � ��0�� � �!2�3�� � ��-�� � ��/�� � ��)�� � ��*�� � ��)�� � ��)�� � ��,�� � ��+�� � ��+�� � ��+�� � ��-r*c
��UR[R"S[R"S[R"5S9S95 g)N�X��id�ctx)�exc�cause)r#r�Raise�Name�LoadrAs r
�test_invalid_raise�"UnparseTestCase.test_invalid_raisets,�����3�9�9��S�X�X��#�(�(�*�5U�V�Wr*c	��UR[R"[R"S[R"5S9[R
"SS9/S95 g)N�testr�rn)�values)r#r�	JoinedStrr�r�rprAs r
�test_invalid_fstring_value�*UnparseTestCase.test_invalid_fstring_valuewsA������M�M��H�H��C�H�H�J�7��L�L�v�.��
�	
r*c
��UR[R"[R"[R"SS9SSS95S5 g)Nz\\rn���)ro�
conversion�format_specz{'\\\\'})r-rr�FormattedValuerprAs r
�test_fstring_backslash�&UnparseTestCase.test_fstring_backslash�s@���������.�.�&)�l�l��&@�+-�,0���*�
	+r*c�J�UR[R"SS95 g)Nrn)r#r�	YieldFromrAs r
�test_invalid_yield_from�'UnparseTestCase.test_invalid_yield_from�s�����3�=�=�t�4�5r*c�>�[R"S[R"SS9/S9nUR[R"U5S5 [R"S[R"SS9/SS9nUR[R"U5S5 g)N�mod�x)�name)�module�nameszfrom mod import x)r�r��level)r�
ImportFrom�aliasr-r)r�trees  r
�test_import_from_level_none�+UnparseTestCase.test_import_from_level_none�sp���~�~�U�3�9�9�#�3F�2G�H��������T�*�,?�@��~�~�U�3�9�9�#�3F�2G�t�T��������T�*�,?�@r*c�D�SnUHnURSUS35 M g)N)
zthis ends with double quote"z"this includes a """triple quote"""�
z\r�	z\t�
z\nz	
\r	\t
\nz$""">>> content = """blabla""" <<<"""z	foo\n\x00z' \'\'\'""" ""\'\' \'u🐍⛎𩸽üéş^\\X\\BB⟿z'''r@)r�
docstrings�	docstrings   r
�test_docstrings�UnparseTestCase.test_docstrings�s,��
�
�$�I��$�$�s�9�+�S�%9�:�$r*c��UR[R"SSS9S5 UR[R"SSS9S5 g)N)�)ro�kindz(1,))r��z	(1, 2, 3))r.rrprAs r
�test_constant_tuples�$UnparseTestCase.test_constant_tuples�s;��� � ����D�t�!D�f�M�� � ��L�L�y�t�4�k�	
r*c�6�SHnURUSS9 M g)N)z	() -> intz(int, int) -> intz=(Callable[complex], More[Complex(call.to_typevar())]) -> None�	func_type)�moder@)r�
function_types  r
�test_function_type�"UnparseTestCase.test_function_type�s#��
�M�

�$�$�]��$�E�
r*c�6�SHnURUSS9 M g)N)z
a = 5 # type:za = 5 # type: intza = 5 # type: int and morez!def x(): # type: () -> None
	passz.def x(y): # type: (int) -> None and more
	passz'async def x(): # type: () -> None
	passz4async def x(y): # type: (int) -> None and more
	passzfor x in y: # type: int
	passz#async for x in y: # type: int
	passzwith x(): # type: int
	passz!async with x(): # type: int
	passT��
type_commentsr@�r�	statements  r
�test_type_comments�"UnparseTestCase.test_type_comments�s#��
�I�
�$�$�Y�d�$�C�
r*c�6�SHnURUSS9 M g)N)
za = 5 # type: ignoreza = 5 # type: ignore and morezdef x(): # type: ignore
	passz'def x(y): # type: ignore and more
	passz#async def x(): # type: ignore
	passz-async def x(y): # type: ignore and more
	passz for x in y: # type: ignore
	passz&async for x in y: # type: ignore
	passzwith x(): # type: ignore
	passz$async with x(): # type: ignore
	passTrr@rs  r
�test_type_ignore� UnparseTestCase.test_type_ignore�s#��
�I�
�$�$�Y�d�$�C�
r*r5N)5r6r7r8r9rBrErJrMrPrSrVrZr^rbrerjrrrvr{r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr
rrrr;r5r*r
r=r=�s���
�*?�8�F�+�
0�,�+�-�6�1�-�
�2�(�4�9�A�2�.�-�+�:�4�
�:�@�2�M�(�5�:�5�.�*�1�B�
.�6X�
�+�6�A�;�(
�F�D� 
Dr*r=c�l�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrg)�CosmeticTestCasei�zATest if there are cosmetic issues caused by unnecessary additionsc��URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS	5 URS
5 URS5 URS5 URS
5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 g)Nz(a := b)zawait xz
x if x else yzlambda x: xz1 + 1z	1 + 2 / 3z(1 + 2) / 3z(1 + 2) * 3 + 4 * (5 + 2)z(1 + 2) * 3 + 4 * (5 + 2) ** 2z~xzx and yz
x and y and zzx and (y and x)z(x and y) and zz(x ** y) ** z ** qzx >> yzx << yzx >> y and x >> zzx + y - z * q ^ t ** kzP * V if P and V else n * R * Tz"lambda P, V, n: P * V == n * R * Tzflag & (other | foo)z
not x == yzx == (not y)zyield xzyield from xzcall((yield x))zreturn x + (yield x)�r.rAs r
�test_simple_expressions_parens�/CosmeticTestCase.test_simple_expressions_parens�s���� � ��,�� � ��+�� � ��1�� � ��/�� � ��)�� � ��-�� � ��/�� � �!<�=�� � �!A�B�� � ��&�� � ��+�� � ��1�� � �!2�3�� � �!2�3�� � �!5�6�� � ��*�� � ��*�� � �!4�5�� � �!9�:�� � �!B�C�� � �!E�F�� � �!7�8�� � ��.�� � ��0�� � ��+�� � ��0�� � �!2�3�� � �!7�8r*c�X�URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS	5 URS
5 g)N�class X:
    passzclass X(A):
    passzclass X(A, B, C, D):
    passzclass X(x=y):
    passzclass X(metaclass=z):
    passzclass X(x=y, z=d):
    passzclass X(A, x=y):
    passzclass X(A, **kw):
    passzclass X(*args):
    passz"class X(*args, **kwargs):
    passrrAs r
�test_class_bases_and_keywords�.CosmeticTestCase.test_class_bases_and_keywords�s���� � �!5�6�� � �!8�9�� � �!A�B�� � �!:�;�� � �!B�C�� � �!?�@�� � �!=�>�� � �!>�?�� � �!<�=�� � �!F�Gr*c���URS5 URS5 URS5 URS5 URS5 URS5 URS5 g)NrHz*f'-{f'''*{f"""+{f".{f'{x}'}."}+"""}*'''}-'z/f'-{f'*{f'''+{f""".{f"{f'{x}'}"}."""}+'''}*'}-'rIzf'{x}\n'zf"{'\n'}\n"zf"{f'{x}\n'}\n"rrAs r
rB�CosmeticTestCase.test_fstringssj��� � �!R�S�� � �!Y�Z�� � �!`�a�� � �!6�7�� � ��-�� � �!4�5�� � �!8�9r*c�^�Sn[H!nUHnURUU35 M M# g)N)
z"""simple doc string"""z7"""A more complex one
            with some newlines"""z,"""Foo bar baz

            empty newline"""z"""With some 	"""z"""Foo "bar" baz """z"""\r"""z""""""z	"""'''"""z"""''''''"""u""""🐍⛎𩸽üéş^\\X\\BB⟿"""z"""end in single 'quote'"""z'''end in double "quote"'''z#"""almost end in double "quote".""")�docstring_prefixesr.)rr�prefixrs    r
r� CosmeticTestCase.test_docstringss6��
�
�&)�F�'�	��(�(�F�8�I�;�)?�@�(�)r*c��Sn[H4nUH+nUU3nURU5 URU5 M- M6 g)N)za = """false"""z("""false""" + """unless its optimized"""z1 + 1
"""false"""z"f"""no, top level but f-fstring""")r)rr3)r�docstrings_negativer*�negative�srcs     r
�test_docstrings_negative_cases�/CosmeticTestCase.test_docstrings_negative_cases$sL��
��)�F�/�� ���
�+���(�(��-��-�-�c�2�0�)r*c�x�SHnURUS35 M SHnURUS35 M g)N)�+�-�~�1)�notz 1r)rr*s  r
�test_unary_op_factor�%CosmeticTestCase.test_unary_op_factor6s>��%�F��$�$��x�q�\�2�&��F��$�$��x�r�]�3�r*c���URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS	5 URS
5 URS5 URS5 URS
5 URS5 g)Nr�za[1]za[1, 2]za[*a,]za[1, *a]za[*a, 2]za[1, *a, 2]r�za[1, *a, *a]za[*a, 1, *a]za[*a, *a, 1]za[1, *a, *a, 2]z
a[1:2, *a]z
a[*a, 1:2]rrAs r
r��CosmeticTestCase.test_slices<s���� � ��)�� � ��(�� � ��+�	
� � ��*�� � ��,�� � ��,�� � ��/�� � ��-�� � ��0�� � ��0�� � ��0�� � �!2�3�� � ��.�� � ��.r*c��URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 g)	Nzlambda: somethingzfour = lambda: 2 + 2zlambda x: x * 2zsquare = lambda n: n ** 2zlambda x, y: x + yzadd = lambda x, y: x + yz lambda x, y, /, z, q, *, u: Nonezlambda x, *y, **z: NonerrAs r
�test_lambda_parameters�'CosmeticTestCase.test_lambda_parametersOsz��� � �!4�5�� � �!7�8�� � �!2�3�� � �!<�=�� � �!5�6�� � �!;�<�� � �!C�D�� � �!:�;r*c	��SHDupSH9nURXS9 URURUS95 SSS5 M; MF g!,(df   MQ=f)N))zsingle assignmentz{target} = foo)zmultiple assignmentz{target} = {target} = bar)zfor loopzfor {target} in foo:
    pass)zasync for loopz#async for {target} in foo:
    pass)�aza,za, bza, *b, cza, (b, c), dza, (b, c, d), *eza, (b, *c, d), eza, (b, *c, (d, e), f), gz[a]z[a, b]z
[a, *b, c]z[a, [b, c], d]z[a, [b, c, d], *e]z[a, [b, *c, d], e]z[a, [b, *c, [d, e], f], g]za, [b, c], dz[a, b, (c, d), (e, f)]za, b, [*c], d, e)�source_type�target)rB)rr.�format)rrA�sourcerBs    r
�test_star_expr_assign_target�-CosmeticTestCase.test_star_expr_assign_targetYsY��$
��K���(�\�\�k�\�I��,�,�V�]�]�&�]�-I�J�J�I�)�
$
�4J�I�s�A�
Ac���URS5 URS5 URS5 URS5 URS5 URS5 URS5 g)Nz() = []z[] = ()z'() = [a] = c, = [d] = e, f = () = g = hz
a = b = c = dza, b = c, d = e, f = gz[a, b] = [c, d] = [e, f] = gza, b = [c, d] = e, f = grrAs r
�%test_star_expr_assign_target_multiple�6CosmeticTestCase.test_star_expr_assign_target_multiplewsh��� � ��+�� � ��+�� � �!J�K�� � ��1�� � �!9�:�� � �!?�@�� � �!;�<r*c�X�URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS	5 URS
5 g)Nzf"'''{1}\"\"\"" zf"'''{1}""\"" zf'"""{1}''' zf'"""{1}""\"' zf"'''{"\n"}""\"" zf'"""{"\n"}''' zf'"""{"\n"}""\"' zf'''"""''\'{"\n"}''' zf'''"""''\'{"\n\"'"}''' z'f'''"""''\'{"""\n\"'''""" '''\n'''}''' r@rAs r
�test_multiquote_joined_string�.CosmeticTestCase.test_multiquote_joined_string�s���� � �!;�<�� � �!6�7�� � �!4�5�� � �!7�8�� � �!:�;�� � �!8�9�� � �!;�<�� � �!?�@�� � �!C�D�� � �!U�Vr*c��SSKnURS5nUR[U5 UR	S5 SSS5 UR	S5 UR	S5 UR[U5 UR	S5 SSS5 UR	S5 UR	S5 g!,(df   N�=f!,(df   NB=f)	Nrzinvalid escape sequence '\ 'z
f"{x:\ }" z
f"{x:\n}" zf"{x:\\ }" zf"{x:\\\ }" zf"{x:\\\n}" z
f"{x:\\\\ }" )�re�escape�assertWarnsRegex�
SyntaxWarningr)rrN�msgs   r
�test_backslash_in_format_spec�.CosmeticTestCase.test_backslash_in_format_spec�s�����i�i�7�8��
�
"�
"�=�#�
6��$�$�%6�7�7�� � �!2�3�� � �!4�5�
�
"�
"�=�#�
6��$�$�%:�;�7�� � �!6�7�� � �!8�9�7�
6��7�
6�s�B;�>C�;
C	�
Cc���URS5 URS5 URS5 URS5 URS5 URS5 g)Nz	f"{x:'}" z
f"{x:\'}" zf"{x:\\'}" zf'\'{x:"}' zf'\'{x:\"}' z
f'\'{x:\\"}' r@rAs r
�test_quote_in_format_spec�*CosmeticTestCase.test_quote_in_format_spec�s[��� � ��1�� � �!2�3�� � �!4�5�� � �!3�4�� � �!5�6�� � �!7�8r*c��URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS5 URS	5 URS
5 URS5 URS5 g)
Nztype A = intztype A[T] = intztype A[T: int] = intztype A[T = int] = intztype A[T: int = int] = intztype A[**P] = intztype A[**P = int] = intztype A[*Ts] = intztype A[*Ts = int] = intztype A[*Ts = *int] = intz6def f[T: int = int, **P = int, *Ts = *int]():
    passz8class C[T: int = int, **P = int, *Ts = *int]():
    passr@rAs r
�test_type_params�!CosmeticTestCase.test_type_params�s���� � ��0�� � �!2�3�� � �!7�8�� � �!8�9�� � �!=�>�� � �!4�5�� � �!:�;�� � �!4�5�� � �!:�;�� � �!;�<�� � �!Z�[�� � �!\�]r*r5N)r6r7r8r9�__doc__r r$rBrr0r8r�r=rErHrKrSrVrYr;r5r*r
rr�sP��K�9�<
H�:�A�03�$4�/�&<�K�<=�W�
:�9�^r*rc�N�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
Srg
)�ManualASTCreationTestCasei�zJTest that AST nodes created without a type_params field unparse correctly.c���[R"S//[R"5//S9n[R"U5 UR	[R
"U5S5 g)Nr�)r��bases�keywords�body�decorator_listr#)r�ClassDef�Pass�fix_missing_locationsr-r�rr s  r
�
test_class�$ManualASTCreationTestCase.test_class�sI���|�|��B��3�8�8�:�,�_a�b���!�!�$�'�������T�*�,@�Ar*c
��[R"S//[R"5//[R"S5/S9n[R"U5 UR[R"U5S5 g)Nr��T)r�r_r`rarb�type_paramszclass X[T]:
    pass)rrcrd�TypeVarrer-rrfs  r
�test_class_with_type_params�5ManualASTCreationTestCase.test_class_with_type_params�sZ���|�|��B��3�8�8�:�,�_a�*-�+�+�c�*:�);�=���!�!�$�'�������T�*�,C�Dr*c
��[R"S[R"//S//S/S9[R"5//SS9n[R"U5 UR[R"U5S5 g)N�f��posonlyargs�args�vararg�
kwonlyargs�kw_defaults�kwarg�defaults�r�rsrarb�returnszdef f():
    pass)r�FunctionDef�	argumentsrdrer-rrfs  r
�
test_function�'ManualASTCreationTestCase.test_function�sj���������2�B�t�PR�`b�jn�y{�|��(�(�*����
��	�!�!�$�'�������T�*�,@�Ar*c
�0�[R"S[R"//S//S/S9[R"5//S[R"S5/S9n[R
"U5 UR
[R"U5S5 g)Nrprqrj�r�rsrarbrzrkzdef f[T]():
    pass)rr{r|rdrlrer-rrfs  r
�test_function_with_type_params�8ManualASTCreationTestCase.test_function_with_type_params�sy���������2�B�t�PR�`b�jn�y{�|��(�(�*�������S�)�*�

��	�!�!�$�'�������T�*�,C�Dr*c�z�[R"S[R"//S//S/S9[R"5//S[R"S[R
"S[R"5S9S9/S9n[R"U5 UR[R"U5S5 g)	Nrprqrj�int)r�)�boundr�zdef f[T: int]():
    pass)
rr{r|rdrlr�r�rer-rrfs  r
�(test_function_with_type_params_and_bound�BManualASTCreationTestCase.test_function_with_type_params_and_bound�s����������2�B�t�PR�`b�jn�y{�|��(�(�*�������S�����C�H�H�J�0O�P�Q�

��	�!�!�$�'�������T�*�,H�Ir*c�(�[R"S[R"5[R"5/[R"S[R
"SS9S9[R"S[R"[R
"SS9[R"5S9S9[R"S[R
"SS9S9/S	9n[R"U5 UR[R"U5S
5 g)Nrprjrrn��
default_value�Ts�ror��P�r�rsrarkz+def f[T = 1, *Ts = *1, **P = 1]():
    pass)
rr{r|rdrlrp�TypeVarTuple�Starredr��	ParamSpecrer-rrfs  r
�*test_function_with_type_params_and_default�DManualASTCreationTestCase.test_function_with_type_params_and_default�s������������(�(�*�����C�s�|�|�!�/D�E�� � ��S�[�[�s�|�|�Z[�G\�be�bj�bj�bl�5m�n��
�
�c����A�1F�G��		
��	�!�!�$�'�������T�*�,Z�[r*c
��[R"S[R"//S//S/S9[R"5//SS9n[R"U5 UR[R"U5S5 g)Nrprqryzasync def f():
    pass)r�AsyncFunctionDefr|rdrer-rrfs  r
�test_async_function�-ManualASTCreationTestCase.test_async_function�sl���#�#�����2�B�t�PR�`b�jn�y{�|��(�(�*����
��	�!�!�$�'�������T�*�,F�Gr*c
�0�[R"S[R"//S//S/S9[R"5//S[R"S5/S9n[R
"U5 UR
[R"U5S5 g)Nrprqrjr�zasync def f[T]():
    pass)rr�r|rdrlrer-rrfs  r
�$test_async_function_with_type_params�>ManualASTCreationTestCase.test_async_function_with_type_params�s{���#�#�����2�B�t�PR�`b�jn�y{�|��(�(�*�������S�)�*�

��	�!�!�$�'�������T�*�,I�Jr*c�(�[R"S[R"5[R"5/[R"S[R
"SS9S9[R"S[R"[R
"SS9[R"5S9S9[R"S[R
"SS9S9/S	9n[R"U5 UR[R"U5S
5 g)Nrprjrrnr�r�r�r�r�z1async def f[T = 1, *Ts = *1, **P = 1]():
    pass)
rr�r|rdrlrpr�r�r�r�rer-rrfs  r
�0test_async_function_with_type_params_and_default�JManualASTCreationTestCase.test_async_function_with_type_params_and_defaults����#�#�������(�(�*�����C�s�|�|�!�/D�E�� � ��S�[�[�s�|�|�Z[�G\�be�bj�bj�bl�5m�n��
�
�c����A�1F�G��		
��	�!�!�$�'�������T�*�,`�ar*r5N)r6r7r8r9r[rgrmr}r�r�r�r�r�r�r;r5r*r
r]r]�s;��T�B�
E�	B�
E�
J�\�	H�
K�br*r]c��\rSrSrSr\R"\5RS-r	\	\	S-4r
1SkrSr\
S5rSrS	rg)
�DirectoryTestCaseiz:Test roundtrip behaviour on all files in Lib and Lib/test.z..r�>
�test_ast.py�
test_patma.py�test_syntax.py�test_compile.py�test_fstring.py�test_grammar.py�test_tokenize.py�test_type_alias.py�test_asdl_parser.py�test_type_params.pyNc�&�URbUR$URVVs/sHNnURS5H5nURR	S5(aM%UR5PM7 MP nnn[RRS5(d[UVs1sH!nURUR;dMUiM# nn[[R"US55n[X4-5nX0lU$s snnfs snf)Nz*.py�bad�cpu�
)�_files_to_test�test_directories�globr��
startswith�resolver��support�is_resource_enabled�run_always_files�set�random�sample�list)�cls�	directory�item�items�tests_to_run_alwayss     r
�
files_to_test�DirectoryTestCase.files_to_test&s������)��%�%�%�!�1�1�
�1�	�!���v�.���9�9�'�'��.�
�D�L�L�N�.�
�1�	�
��|�|�/�/��6�6�49�#F�E�D�#'�9�9��0D�0D�#D�$(�E��#F���
�
�e�R�0�1�E���4�5�E�#�����/
��#Fs�9D�&D�)D�Dc�4�UR5Hrn[RR(a[	SUR535 UR
US9 [U5nURU5 SSS5 Mt g!,(df   M�=f)NzTesting )r)	r�r�r��verbose�print�absoluterrr)rr�rDs   r
�
test_files�DirectoryTestCase.test_filesEso���&�&�(�D��|�|�#�#������� 1�2�3����t��,�$�T�*���(�(��0�-�,�	)�-�,�s�B�
B	r5)r6r7r8r9r[�pathlib�Path�__file__�parent�lib_dirr�r�r��classmethodr�r�r;r5r*r
r�r�sT��D��l�l�8�$�+�+�d�2�G���6�!1�2��,��
�N�����<1r*r��__main__)!r[�unittest�test.supportr�r�r�rr�test.support.ast_helperrrrYr]r�r�r�r�r�r�r�r�r�r�r�r)�TestCaserr=rr]r�r6�mainr5r*r
�<module>r�s�������
��
�0�����
���	���
���	��	��������
��
��
��.�,�� 1� 1�.�6tD�k�tD�n	\^�{�\^�~bb�� 1� 1�bb�J21��21�j�z���M�M�O�r*

Youez - 2016 - github.com/yon3zu
LinuXploit