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 for x, in (1,), (2,), (3,): ...
168 for z in (i for i in (1, 2, 3)): ...
169 for i in (call()): ...
170 for j in (1 + (2 + 3)): ...
171 while(this and that): ...
173 threading.current_thread() != threading.main_thread() and
174 threading.current_thread() != threading.main_thread() or
175 signal.getsignal(signal.SIGINT) != signal.default_int_handler
179 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
180 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
184 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &
185 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
189 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
190 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
194 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -
195 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
199 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
200 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
204 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /
205 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
209 # standalone comment at ENDMARKER
226 True or False or None
228 True and False and None
229 (Name1 and Name2) or Name3
230 Name1 and Name2 or Name3
231 Name1 or (Name2 and Name3)
232 Name1 or Name2 and Name3
233 (Name1 and Name2) or (Name3 and Name4)
234 Name1 and Name2 or Name3 and Name4
235 Name1 or (Name2 and Name3) or Name4
236 Name1 or Name2 and Name3 or Name4
240 1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8
241 ((1 + v2) - (v3 * 4)) ^ (((5 ** v6) / 7) // 8)
246 ~int and not v1 ^ 123 + v2 | True
247 (~int) and (not ((v1 ^ (123 + v2)) | True))
248 flags & ~select.EPOLLIN and waiters.write_task is not None
251 lambda a, b, c=True: a
252 lambda a, b, c=True, *, d=(1 << v2), e="str": a
253 lambda a, b, c=True, *vararg, d=(v1 << 2), e="str", **kwargs: a + b
255 lambda port_id, ignore_missing: {"port1": port1_resource, "port2": port2_resource}[
260 str or None if True else str or bytes or None
261 (str or None) if True else (str or bytes or None)
262 str or None if (1 if True else 2) else str or bytes or None
263 (str or None) if (1 if True else 2) else (str or bytes or None)
265 (super_long_variable_name or None)
266 if (1 if super_long_test_name else 2)
267 else (str or bytes or None)
269 {"2.7": dead, "3.7": (long_live or die_hard)}
270 {"2.7": dead, "3.7": (long_live or die_hard), **{"3.6": verygood}}
272 {"2.7", "3.6", "3.7", "3.8", "3.9", ("4.0" if gilectomy else "3.10")}
273 ({"a": "b"}, (True or False), (+value), "string", b"bytes") or None
279 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
286 this_is_a_very_long_variable_which_will_force_a_delimiter_split,
291 {i for i in (1, 2, 3)}
292 {(i ** 2) for i in (1, 2, 3)}
293 {(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))}
294 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
295 [i for i in (1, 2, 3)]
296 [(i ** 2) for i in (1, 2, 3)]
297 [(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))]
298 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
299 {i: 0 for i in (1, 2, 3)}
300 {i: j for i, j in ((1, "a"), (2, "b"), (3, "c"))}
301 {a: b * 2 for a, b in dictionary.items()}
302 {a: b * -2 for a, b in dictionary.items()}
305 for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
307 Python3 > Python2 > COBOL
312 call(arg, kwarg="hey")
313 call(arg, another, kwarg="hey", **kwargs)
315 this_is_a_very_long_variable_which_will_force_a_delimiter_split,
320 ) # note: no trailing comma pre-3.6
322 call(a, *gidgets[:2])
323 call(**self.screen_kwargs)
324 call(b, **self.screen_kwargs)
333 tuple[str, int, float, dict[str, int]]
334 very_long_variable_name_filters: t.List[
335 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
355 numpy[:, (0, 1, 2, 5)]
363 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
364 {"2.7": dead, "3.7": long_live or die_hard}
365 {"2.7", "3.6", "3.7", "3.8", "3.9", "4.0" if gilectomy else "3.10"}
366 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
370 (i for i in (1, 2, 3))
371 ((i ** 2) for i in (1, 2, 3))
372 ((i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c")))
373 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
379 "ended_at": now() + timedelta(days=10),
381 "import_session_id": 1,
389 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
392 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
395 result = session.query(models.Customer.id).filter(
396 models.Customer.account_id == account_id, models.Customer.email == email_address
398 models.Customer.id.asc()
401 authors.łukasz.say_thanks()
403 A: 0.25 * (10.0 / 12),
404 B: 0.1 * (10.0 / 12),
405 C: 0.1 * (10.0 / 12),
406 D: 0.1 * (10.0 / 12),
411 yield from outside_of_generator
416 await some.complicated[0].call(with_args=(True or (1 is not 1)))
420 print(**{1: 3} if False else {x: x for x in range(3)})
422 for (x,) in (1,), (2,), (3,):
426 for z in (i for i in (1, 2, 3)):
430 for j in 1 + (2 + 3):
435 threading.current_thread() != threading.main_thread()
436 and threading.current_thread() != threading.main_thread()
437 or signal.getsignal(signal.SIGINT) != signal.default_int_handler
441 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
442 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
446 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
447 & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
451 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
452 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
456 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
457 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
461 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
462 * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
466 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
467 / aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
471 # standalone comment at ENDMARKER