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 flags & ~ select.EPOLLIN and waiters.write_task is not None
37 lambda a, b, c=True: a
38 lambda a, b, c=True, *, d=(1 << v2), e='str': a
39 lambda a, b, c=True, *vararg, d=(v1 << 2), e='str', **kwargs: a + b
40 foo = (lambda port_id, ignore_missing: {"port1": port1_resource, "port2": port2_resource}[port_id])
42 str or None if True else str or bytes or None
43 (str or None) if True else (str or bytes or None)
44 str or None if (1 if True else 2) else str or bytes or None
45 (str or None) if (1 if True else 2) else (str or bytes or None)
46 ((super_long_variable_name or None) if (1 if super_long_test_name else 2) else (str or bytes or None))
47 {'2.7': dead, '3.7': (long_live or die_hard)}
48 {'2.7': dead, '3.7': (long_live or die_hard), **{'3.6': verygood}}
50 {'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')}
51 ({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None
57 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
63 [this_is_a_very_long_variable_which_will_force_a_delimiter_split, element, another, *more]
64 {i for i in (1, 2, 3)}
65 {(i ** 2) for i in (1, 2, 3)}
66 {(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
67 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
68 [i for i in (1, 2, 3)]
69 [(i ** 2) for i in (1, 2, 3)]
70 [(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]
71 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
72 {i: 0 for i in (1, 2, 3)}
73 {i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
74 {a: b * 2 for a, b in dictionary.items()}
75 {a: b * -2 for a, b in dictionary.items()}
76 {k: v for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension}
77 Python3 > Python2 > COBOL
82 call(arg, kwarg='hey')
83 call(arg, another, kwarg='hey', **kwargs)
84 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
87 call(**self.screen_kwargs)
88 call(b, **self.screen_kwargs)
97 tuple[str, int, float, dict[str, int],]
98 very_long_variable_name_filters: t.List[
99 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
119 numpy[:, (0, 1, 2, 5)]
127 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
128 {'2.7': dead, '3.7': long_live or die_hard}
129 {'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
130 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
134 (i for i in (1, 2, 3))
135 ((i ** 2) for i in (1, 2, 3))
136 ((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
137 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
139 {"id": "1","type": "type","started_at": now(),"ended_at": now() + timedelta(days=10),"priority": 1,"import_session_id": 1,**kwargs}
145 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
146 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
147 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()
149 authors.łukasz.say_thanks()
151 A: 0.25 * (10.0 / 12),
152 B: 0.1 * (10.0 / 12),
153 C: 0.1 * (10.0 / 12),
154 D: 0.1 * (10.0 / 12),
158 yield from outside_of_generator
162 await some.complicated[0].call(with_args=(True or (1 is not 1)))
164 print(**{1: 3} if False else {x: x for x in range(3)})
166 assert(not Test),("Short message")
167 assert this is ComplexTest and not requirements.fit_in_a_single_line(force=False), "Short message"
168 assert(((parens is TooMany)))
169 for x, in (1,), (2,), (3,): ...
171 for z in (i for i in (1, 2, 3)): ...
172 for i in (call()): ...
173 for j in (1 + (2 + 3)): ...
174 while(this and that): ...
176 threading.current_thread() != threading.main_thread() and
177 threading.current_thread() != threading.main_thread() or
178 signal.getsignal(signal.SIGINT) != signal.default_int_handler
182 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
183 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
187 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &
188 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
192 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
193 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
197 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -
198 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
202 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
203 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
207 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /
208 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
212 # standalone comment at ENDMARKER
229 True or False or None
231 True and False and None
232 (Name1 and Name2) or Name3
233 Name1 and Name2 or Name3
234 Name1 or (Name2 and Name3)
235 Name1 or Name2 and Name3
236 (Name1 and Name2) or (Name3 and Name4)
237 Name1 and Name2 or Name3 and Name4
238 Name1 or (Name2 and Name3) or Name4
239 Name1 or Name2 and Name3 or Name4
243 1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8
244 ((1 + v2) - (v3 * 4)) ^ (((5 ** v6) / 7) // 8)
249 ~int and not v1 ^ 123 + v2 | True
250 (~int) and (not ((v1 ^ (123 + v2)) | True))
251 flags & ~select.EPOLLIN and waiters.write_task is not None
254 lambda a, b, c=True: a
255 lambda a, b, c=True, *, d=(1 << v2), e="str": a
256 lambda a, b, c=True, *vararg, d=(v1 << 2), e="str", **kwargs: a + b
258 lambda port_id, ignore_missing: {"port1": port1_resource, "port2": port2_resource}[
263 str or None if True else str or bytes or None
264 (str or None) if True else (str or bytes or None)
265 str or None if (1 if True else 2) else str or bytes or None
266 (str or None) if (1 if True else 2) else (str or bytes or None)
268 (super_long_variable_name or None)
269 if (1 if super_long_test_name else 2)
270 else (str or bytes or None)
272 {"2.7": dead, "3.7": (long_live or die_hard)}
273 {"2.7": dead, "3.7": (long_live or die_hard), **{"3.6": verygood}}
275 {"2.7", "3.6", "3.7", "3.8", "3.9", ("4.0" if gilectomy else "3.10")}
276 ({"a": "b"}, (True or False), (+value), "string", b"bytes") or None
282 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
289 this_is_a_very_long_variable_which_will_force_a_delimiter_split,
294 {i for i in (1, 2, 3)}
295 {(i ** 2) for i in (1, 2, 3)}
296 {(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))}
297 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
298 [i for i in (1, 2, 3)]
299 [(i ** 2) for i in (1, 2, 3)]
300 [(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))]
301 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
302 {i: 0 for i in (1, 2, 3)}
303 {i: j for i, j in ((1, "a"), (2, "b"), (3, "c"))}
304 {a: b * 2 for a, b in dictionary.items()}
305 {a: b * -2 for a, b in dictionary.items()}
308 for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
310 Python3 > Python2 > COBOL
315 call(arg, kwarg="hey")
316 call(arg, another, kwarg="hey", **kwargs)
318 this_is_a_very_long_variable_which_will_force_a_delimiter_split,
323 ) # note: no trailing comma pre-3.6
325 call(a, *gidgets[:2])
326 call(**self.screen_kwargs)
327 call(b, **self.screen_kwargs)
336 tuple[str, int, float, dict[str, int]]
337 very_long_variable_name_filters: t.List[
338 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
358 numpy[:, (0, 1, 2, 5)]
366 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
367 {"2.7": dead, "3.7": long_live or die_hard}
368 {"2.7", "3.6", "3.7", "3.8", "3.9", "4.0" if gilectomy else "3.10"}
369 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
373 (i for i in (1, 2, 3))
374 ((i ** 2) for i in (1, 2, 3))
375 ((i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c")))
376 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
382 "ended_at": now() + timedelta(days=10),
384 "import_session_id": 1,
392 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
395 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
398 result = session.query(models.Customer.id).filter(
399 models.Customer.account_id == account_id, models.Customer.email == email_address
401 models.Customer.id.asc()
404 authors.łukasz.say_thanks()
406 A: 0.25 * (10.0 / 12),
407 B: 0.1 * (10.0 / 12),
408 C: 0.1 * (10.0 / 12),
409 D: 0.1 * (10.0 / 12),
414 yield from outside_of_generator
419 await some.complicated[0].call(with_args=(True or (1 is not 1)))
423 print(**{1: 3} if False else {x: x for x in range(3)})
425 assert not Test, "Short message"
427 this is ComplexTest and not requirements.fit_in_a_single_line(force=False)
429 assert parens is TooMany
430 for (x,) in (1,), (2,), (3,):
434 for z in (i for i in (1, 2, 3)):
438 for j in 1 + (2 + 3):
443 threading.current_thread() != threading.main_thread()
444 and threading.current_thread() != threading.main_thread()
445 or signal.getsignal(signal.SIGINT) != signal.default_int_handler
449 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
450 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
454 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
455 & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
459 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
460 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
464 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
465 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
469 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
470 * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
474 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
475 / aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
479 # standalone comment at ENDMARKER