All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
14 True and False and None
15 (Name1 and Name2) or Name3
16 Name1 and Name2 or Name3
17 Name1 or (Name2 and Name3)
18 Name1 or Name2 and Name3
19 (Name1 and Name2) or (Name3 and Name4)
20 Name1 and Name2 or Name3 and Name4
21 Name1 or (Name2 and Name3) or Name4
22 Name1 or Name2 and Name3 or Name4
26 1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8
27 ((1 + v2) - (v3 * 4)) ^ (((5 ** v6) / 7) // 8)
32 ~int and not v1 ^ 123 + v2 | True
33 (~int) and (not ((v1 ^ (123 + v2)) | True))
34 +really ** -confusing ** ~operator ** -precedence
35 flags & ~ select.EPOLLIN and waiters.write_task is not None
38 lambda a, b, c=True: a
39 lambda a, b, c=True, *, d=(1 << v2), e='str': a
40 lambda a, b, c=True, *vararg, d=(v1 << 2), e='str', **kwargs: a + b
41 manylambdas = lambda x=lambda y=lambda z=1: z: y(): x()
42 foo = (lambda port_id, ignore_missing: {"port1": port1_resource, "port2": port2_resource}[port_id])
44 str or None if True else str or bytes or None
45 (str or None) if True else (str or bytes or None)
46 str or None if (1 if True else 2) else str or bytes or None
47 (str or None) if (1 if True else 2) else (str or bytes or None)
48 ((super_long_variable_name or None) if (1 if super_long_test_name else 2) else (str or bytes or None))
49 {'2.7': dead, '3.7': (long_live or die_hard)}
50 {'2.7': dead, '3.7': (long_live or die_hard), **{'3.6': verygood}}
52 {'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')}
53 ({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None
59 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
65 [this_is_a_very_long_variable_which_will_force_a_delimiter_split, element, another, *more]
66 {i for i in (1, 2, 3)}
67 {(i ** 2) for i in (1, 2, 3)}
68 {(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
69 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
70 [i for i in (1, 2, 3)]
71 [(i ** 2) for i in (1, 2, 3)]
72 [(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]
73 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
74 {i: 0 for i in (1, 2, 3)}
75 {i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
76 {a: b * 2 for a, b in dictionary.items()}
77 {a: b * -2 for a, b in dictionary.items()}
78 {k: v for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension}
79 Python3 > Python2 > COBOL
84 call(arg, kwarg='hey')
85 call(arg, another, kwarg='hey', **kwargs)
86 call(this_is_a_very_long_variable_which_will_force_a_delimiter_split, arg, another, kwarg='hey', **kwargs) # note: no trailing comma pre-3.6
89 call(**self.screen_kwargs)
90 call(b, **self.screen_kwargs)
100 str, int, float, dict[str, int]
102 tuple[str, int, float, dict[str, int],]
103 very_long_variable_name_filters: t.List[
104 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
106 xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
107 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
109 xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
110 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
112 xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[
114 ] = classmethod(sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)) # type: ignore
133 numpy[:, (0, 1, 2, 5)]
141 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
142 {'2.7': dead, '3.7': long_live or die_hard}
143 {'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
144 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
148 (i for i in (1, 2, 3))
149 ((i ** 2) for i in (1, 2, 3))
150 ((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
151 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
153 {"id": "1","type": "type","started_at": now(),"ended_at": now() + timedelta(days=10),"priority": 1,"import_session_id": 1,**kwargs}
161 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
162 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
163 result = session.query(models.Customer.id).filter(models.Customer.account_id == account_id, models.Customer.email == email_address).order_by(models.Customer.id.asc()).all()
164 result = session.query(models.Customer.id).filter(models.Customer.account_id == account_id, models.Customer.email == email_address).order_by(models.Customer.id.asc(),).all()
166 authors.łukasz.say_thanks()
168 A: 0.25 * (10.0 / 12),
169 B: 0.1 * (10.0 / 12),
170 C: 0.1 * (10.0 / 12),
171 D: 0.1 * (10.0 / 12),
175 yield from outside_of_generator
181 await some.complicated[0].call(with_args=(True or (1 is not 1)))
183 print(**{1: 3} if False else {x: x for x in range(3)})
185 assert(not Test),("Short message")
186 assert this is ComplexTest and not requirements.fit_in_a_single_line(force=False), "Short message"
187 assert(((parens is TooMany)))
188 for x, in (1,), (2,), (3,): ...
190 for z in (i for i in (1, 2, 3)): ...
191 for i in (call()): ...
192 for j in (1 + (2 + 3)): ...
193 while(this and that): ...
194 for addr_family, addr_type, addr_proto, addr_canonname, addr_sockaddr in socket.getaddrinfo('google.com', 'http'):
196 a = aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
197 a = aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp not in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
198 a = aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp is qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
199 a = aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp is not qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
201 threading.current_thread() != threading.main_thread() and
202 threading.current_thread() != threading.main_thread() or
203 signal.getsignal(signal.SIGINT) != signal.default_int_handler
207 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
208 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
212 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &
213 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
217 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
218 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
222 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -
223 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
227 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
228 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
232 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /
233 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
237 ~ aaaa.a + aaaa.b - aaaa.c * aaaa.d / aaaa.e | aaaa.f & aaaa.g % aaaa.h ^ aaaa.i << aaaa.k >> aaaa.l ** aaaa.m // aaaa.n
241 ~ aaaaaaaa.a + aaaaaaaa.b - aaaaaaaa.c @ aaaaaaaa.d / aaaaaaaa.e | aaaaaaaa.f & aaaaaaaa.g % aaaaaaaa.h ^ aaaaaaaa.i << aaaaaaaa.k >> aaaaaaaa.l ** aaaaaaaa.m // aaaaaaaa.n
245 ~ aaaaaaaaaaaaaaaa.a + aaaaaaaaaaaaaaaa.b - aaaaaaaaaaaaaaaa.c * aaaaaaaaaaaaaaaa.d @ aaaaaaaaaaaaaaaa.e | aaaaaaaaaaaaaaaa.f & aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h ^ aaaaaaaaaaaaaaaa.i << aaaaaaaaaaaaaaaa.k >> aaaaaaaaaaaaaaaa.l ** aaaaaaaaaaaaaaaa.m // aaaaaaaaaaaaaaaa.n
249 # standalone comment at ENDMARKER
266 True or False or None
268 True and False and None
269 (Name1 and Name2) or Name3
270 Name1 and Name2 or Name3
271 Name1 or (Name2 and Name3)
272 Name1 or Name2 and Name3
273 (Name1 and Name2) or (Name3 and Name4)
274 Name1 and Name2 or Name3 and Name4
275 Name1 or (Name2 and Name3) or Name4
276 Name1 or Name2 and Name3 or Name4
280 1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8
281 ((1 + v2) - (v3 * 4)) ^ (((5 ** v6) / 7) // 8)
286 ~int and not v1 ^ 123 + v2 | True
287 (~int) and (not ((v1 ^ (123 + v2)) | True))
288 +(really ** -(confusing ** ~(operator ** -precedence)))
289 flags & ~select.EPOLLIN and waiters.write_task is not None
292 lambda a, b, c=True: a
293 lambda a, b, c=True, *, d=(1 << v2), e="str": a
294 lambda a, b, c=True, *vararg, d=(v1 << 2), e="str", **kwargs: a + b
295 manylambdas = lambda x=lambda y=lambda z=1: z: y(): x()
296 foo = lambda port_id, ignore_missing: {
297 "port1": port1_resource,
298 "port2": port2_resource,
301 str or None if True else str or bytes or None
302 (str or None) if True else (str or bytes or None)
303 str or None if (1 if True else 2) else str or bytes or None
304 (str or None) if (1 if True else 2) else (str or bytes or None)
306 (super_long_variable_name or None)
307 if (1 if super_long_test_name else 2)
308 else (str or bytes or None)
310 {"2.7": dead, "3.7": (long_live or die_hard)}
311 {"2.7": dead, "3.7": (long_live or die_hard), **{"3.6": verygood}}
313 {"2.7", "3.6", "3.7", "3.8", "3.9", ("4.0" if gilectomy else "3.10")}
314 ({"a": "b"}, (True or False), (+value), "string", b"bytes") or None
320 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
339 this_is_a_very_long_variable_which_will_force_a_delimiter_split,
344 {i for i in (1, 2, 3)}
345 {(i ** 2) for i in (1, 2, 3)}
346 {(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))}
347 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
348 [i for i in (1, 2, 3)]
349 [(i ** 2) for i in (1, 2, 3)]
350 [(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))]
351 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
352 {i: 0 for i in (1, 2, 3)}
353 {i: j for i, j in ((1, "a"), (2, "b"), (3, "c"))}
354 {a: b * 2 for a, b in dictionary.items()}
355 {a: b * -2 for a, b in dictionary.items()}
358 for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
360 Python3 > Python2 > COBOL
365 call(arg, kwarg="hey")
366 call(arg, another, kwarg="hey", **kwargs)
368 this_is_a_very_long_variable_which_will_force_a_delimiter_split,
373 ) # note: no trailing comma pre-3.6
375 call(a, *gidgets[:2])
376 call(**self.screen_kwargs)
377 call(b, **self.screen_kwargs)
386 tuple[str, int, float, dict[str, int]]
393 very_long_variable_name_filters: t.List[
394 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
396 xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
397 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
399 xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
400 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
402 xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod(
403 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
423 numpy[:, (0, 1, 2, 5)]
431 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
432 {"2.7": dead, "3.7": long_live or die_hard}
433 {"2.7", "3.6", "3.7", "3.8", "3.9", "4.0" if gilectomy else "3.10"}
434 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
438 (i for i in (1, 2, 3))
439 ((i ** 2) for i in (1, 2, 3))
440 ((i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c")))
441 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
447 "ended_at": now() + timedelta(days=10),
449 "import_session_id": 1,
459 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
462 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
466 session.query(models.Customer.id)
468 models.Customer.account_id == account_id, models.Customer.email == email_address
470 .order_by(models.Customer.id.asc())
474 session.query(models.Customer.id)
476 models.Customer.account_id == account_id, models.Customer.email == email_address
479 models.Customer.id.asc(),
484 authors.łukasz.say_thanks()
486 A: 0.25 * (10.0 / 12),
487 B: 0.1 * (10.0 / 12),
488 C: 0.1 * (10.0 / 12),
489 D: 0.1 * (10.0 / 12),
494 yield from outside_of_generator
501 await some.complicated[0].call(with_args=(True or (1 is not 1)))
505 print(**{1: 3} if False else {x: x for x in range(3)})
507 assert not Test, "Short message"
508 assert this is ComplexTest and not requirements.fit_in_a_single_line(
511 assert parens is TooMany
512 for (x,) in (1,), (2,), (3,):
516 for z in (i for i in (1, 2, 3)):
520 for j in 1 + (2 + 3):
530 ) in socket.getaddrinfo("google.com", "http"):
533 aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
534 in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
537 aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
538 not in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
541 aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
542 is qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
545 aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
546 is not qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
549 threading.current_thread() != threading.main_thread()
550 and threading.current_thread() != threading.main_thread()
551 or signal.getsignal(signal.SIGINT) != signal.default_int_handler
555 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
556 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
560 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
561 & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
565 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
566 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
570 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
571 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
575 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
576 * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
580 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
581 / aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
585 ~aaaa.a + aaaa.b - aaaa.c * aaaa.d / aaaa.e
586 | aaaa.f & aaaa.g % aaaa.h ^ aaaa.i << aaaa.k >> aaaa.l ** aaaa.m // aaaa.n
590 ~aaaaaaaa.a + aaaaaaaa.b - aaaaaaaa.c @ aaaaaaaa.d / aaaaaaaa.e
591 | aaaaaaaa.f & aaaaaaaa.g % aaaaaaaa.h
592 ^ aaaaaaaa.i << aaaaaaaa.k >> aaaaaaaa.l ** aaaaaaaa.m // aaaaaaaa.n
598 - aaaaaaaaaaaaaaaa.c * aaaaaaaaaaaaaaaa.d @ aaaaaaaaaaaaaaaa.e
599 | aaaaaaaaaaaaaaaa.f & aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h
601 << aaaaaaaaaaaaaaaa.k
602 >> aaaaaaaaaaaaaaaa.l ** aaaaaaaaaaaaaaaa.m // aaaaaaaaaaaaaaaa.n
606 # standalone comment at ENDMARKER