X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a764f1bb3b459ee6f2e752e3d67793b119a2144a..6dbb657681b82268f66bd788991a4daa737577dc:/tests/expression.py?ds=sidebyside diff --git a/tests/expression.py b/tests/expression.py index 9c07177..d170a66 100644 --- a/tests/expression.py +++ b/tests/expression.py @@ -37,11 +37,13 @@ lambda a=True: a lambda a, b, c=True: a lambda a, b, c=True, *, d=(1 << v2), e='str': a lambda a, b, c=True, *vararg, d=(v1 << 2), e='str', **kwargs: a + b +foo = (lambda port_id, ignore_missing: {"port1": port1_resource, "port2": port2_resource}[port_id]) 1 if True else 2 str or None if True else str or bytes or None (str or None) if True else (str or bytes or None) str or None if (1 if True else 2) else str or bytes or None (str or None) if (1 if True else 2) else (str or bytes or None) +((super_long_variable_name or None) if (1 if super_long_test_name else 2) else (str or bytes or None)) {'2.7': dead, '3.7': (long_live or die_hard)} {'2.7': dead, '3.7': (long_live or die_hard), **{'3.6': verygood}} {**a, **b, **c} @@ -103,7 +105,7 @@ slice[:] slice[:-1] slice[1:] slice[::-1] -slice[d::d + 1] +slice[d :: d + 1] slice[:c, c - 1] numpy[:, 0:1] numpy[:, :-1] @@ -117,8 +119,8 @@ numpy[4:, 2:] numpy[:, (0, 1, 2, 5)] numpy[0, [0]] numpy[:, [i]] -numpy[1:c + 1, c] -numpy[-(c + 1):, d] +numpy[1 : c + 1, c] +numpy[-(c + 1) :, d] numpy[:, l[-2]] numpy[:, ::-1] numpy[np.newaxis, :] @@ -158,6 +160,9 @@ def gen(): async def f(): await some.complicated[0].call(with_args=(True or (1 is not 1))) +print(* [] or [1]) +print(**{1: 3} if False else {x: x for x in range(3)}) +print(* lambda x: x) for x, in (1,), (2,), (3,): ... for y in (): ... for z in (i for i in (1, 2, 3)): ... @@ -246,11 +251,21 @@ lambda a=True: a lambda a, b, c=True: a lambda a, b, c=True, *, d=(1 << v2), e="str": a lambda a, b, c=True, *vararg, d=(v1 << 2), e="str", **kwargs: a + b +foo = ( + lambda port_id, ignore_missing: {"port1": port1_resource, "port2": port2_resource}[ + port_id + ] +) 1 if True else 2 str or None if True else str or bytes or None (str or None) if True else (str or bytes or None) str or None if (1 if True else 2) else str or bytes or None (str or None) if (1 if True else 2) else (str or bytes or None) +( + (super_long_variable_name or None) + if (1 if super_long_test_name else 2) + else (str or bytes or None) +) {"2.7": dead, "3.7": (long_live or die_hard)} {"2.7": dead, "3.7": (long_live or die_hard), **{"3.6": verygood}} {**a, **b, **c} @@ -326,7 +341,7 @@ slice[:] slice[:-1] slice[1:] slice[::-1] -slice[d::d + 1] +slice[d :: d + 1] slice[:c, c - 1] numpy[:, 0:1] numpy[:, :-1] @@ -340,8 +355,8 @@ numpy[4:, 2:] numpy[:, (0, 1, 2, 5)] numpy[0, [0]] numpy[:, [i]] -numpy[1:c + 1, c] -numpy[-(c + 1):, d] +numpy[1 : c + 1, c] +numpy[-(c + 1) :, d] numpy[:, l[-2]] numpy[:, ::-1] numpy[np.newaxis, :] @@ -394,7 +409,6 @@ mapping = { def gen(): yield from outside_of_generator - a = (yield) @@ -402,6 +416,9 @@ async def f(): await some.complicated[0].call(with_args=(True or (1 is not 1))) +print(*[] or [1]) +print(**{1: 3} if False else {x: x for x in range(3)}) +print(*lambda x: x) for (x,) in (1,), (2,), (3,): ... for y in (): @@ -420,42 +437,35 @@ if ( or signal.getsignal(signal.SIGINT) != signal.default_int_handler ): return True - if ( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ): return True - if ( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ): return True - if ( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ): return True - if ( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ): return True - if ( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ): return True - if ( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa / aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ): return True - last_call() # standalone comment at ENDMARKER