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 {'2.7': dead, '3.7': (long_live or die_hard)}
47 {'2.7': dead, '3.7': (long_live or die_hard), **{'3.6': verygood}}
49 {'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')}
50 ({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None
56 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
62 [this_is_a_very_long_variable_which_will_force_a_delimiter_split, element, another, *more]
63 {i for i in (1, 2, 3)}
64 {(i ** 2) for i in (1, 2, 3)}
65 {(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
66 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
67 [i for i in (1, 2, 3)]
68 [(i ** 2) for i in (1, 2, 3)]
69 [(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]
70 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
71 {i: 0 for i in (1, 2, 3)}
72 {i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
73 {a: b * 2 for a, b in dictionary.items()}
74 {a: b * -2 for a, b in dictionary.items()}
75 {k: v for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension}
76 Python3 > Python2 > COBOL
81 call(arg, kwarg='hey')
82 call(arg, another, kwarg='hey', **kwargs)
83 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
86 call(**self.screen_kwargs)
87 call(b, **self.screen_kwargs)
96 tuple[str, int, float, dict[str, int],]
97 very_long_variable_name_filters: t.List[
98 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
118 numpy[:, (0, 1, 2, 5)]
126 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
127 {'2.7': dead, '3.7': long_live or die_hard}
128 {'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
129 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
133 (i for i in (1, 2, 3))
134 ((i ** 2) for i in (1, 2, 3))
135 ((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
136 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
138 {"id": "1","type": "type","started_at": now(),"ended_at": now() + timedelta(days=10),"priority": 1,"import_session_id": 1,**kwargs}
144 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
145 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
146 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()
148 authors.łukasz.say_thanks()
150 A: 0.25 * (10.0 / 12),
151 B: 0.1 * (10.0 / 12),
152 C: 0.1 * (10.0 / 12),
153 D: 0.1 * (10.0 / 12),
157 yield from outside_of_generator
161 await some.complicated[0].call(with_args=(True or (1 is not 1)))
163 print(**{1: 3} if False else {x: x for x in range(3)})
165 for x, in (1,), (2,), (3,): ...
167 for z in (i for i in (1, 2, 3)): ...
168 for i in (call()): ...
169 for j in (1 + (2 + 3)): ...
170 while(this and that): ...
172 threading.current_thread() != threading.main_thread() and
173 threading.current_thread() != threading.main_thread() or
174 signal.getsignal(signal.SIGINT) != signal.default_int_handler
178 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
179 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
183 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &
184 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
188 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
189 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
193 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -
194 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
198 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
199 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
203 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /
204 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
208 # standalone comment at ENDMARKER
225 True or False or None
227 True and False and None
228 (Name1 and Name2) or Name3
229 Name1 and Name2 or Name3
230 Name1 or (Name2 and Name3)
231 Name1 or Name2 and Name3
232 (Name1 and Name2) or (Name3 and Name4)
233 Name1 and Name2 or Name3 and Name4
234 Name1 or (Name2 and Name3) or Name4
235 Name1 or Name2 and Name3 or Name4
239 1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8
240 ((1 + v2) - (v3 * 4)) ^ (((5 ** v6) / 7) // 8)
245 ~int and not v1 ^ 123 + v2 | True
246 (~int) and (not ((v1 ^ (123 + v2)) | True))
247 flags & ~select.EPOLLIN and waiters.write_task is not None
250 lambda a, b, c=True: a
251 lambda a, b, c=True, *, d=(1 << v2), e="str": a
252 lambda a, b, c=True, *vararg, d=(v1 << 2), e="str", **kwargs: a + b
254 lambda port_id, ignore_missing: {"port1": port1_resource, "port2": port2_resource}[
259 str or None if True else str or bytes or None
260 (str or None) if True else (str or bytes or None)
261 str or None if (1 if True else 2) else str or bytes or None
262 (str or None) if (1 if True else 2) else (str or bytes or None)
263 {"2.7": dead, "3.7": (long_live or die_hard)}
264 {"2.7": dead, "3.7": (long_live or die_hard), **{"3.6": verygood}}
266 {"2.7", "3.6", "3.7", "3.8", "3.9", ("4.0" if gilectomy else "3.10")}
267 ({"a": "b"}, (True or False), (+value), "string", b"bytes") or None
273 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
280 this_is_a_very_long_variable_which_will_force_a_delimiter_split,
285 {i for i in (1, 2, 3)}
286 {(i ** 2) for i in (1, 2, 3)}
287 {(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))}
288 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
289 [i for i in (1, 2, 3)]
290 [(i ** 2) for i in (1, 2, 3)]
291 [(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))]
292 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
293 {i: 0 for i in (1, 2, 3)}
294 {i: j for i, j in ((1, "a"), (2, "b"), (3, "c"))}
295 {a: b * 2 for a, b in dictionary.items()}
296 {a: b * -2 for a, b in dictionary.items()}
299 for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
301 Python3 > Python2 > COBOL
306 call(arg, kwarg="hey")
307 call(arg, another, kwarg="hey", **kwargs)
309 this_is_a_very_long_variable_which_will_force_a_delimiter_split,
314 ) # note: no trailing comma pre-3.6
316 call(a, *gidgets[:2])
317 call(**self.screen_kwargs)
318 call(b, **self.screen_kwargs)
327 tuple[str, int, float, dict[str, int]]
328 very_long_variable_name_filters: t.List[
329 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
349 numpy[:, (0, 1, 2, 5)]
357 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
358 {"2.7": dead, "3.7": long_live or die_hard}
359 {"2.7", "3.6", "3.7", "3.8", "3.9", "4.0" if gilectomy else "3.10"}
360 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
364 (i for i in (1, 2, 3))
365 ((i ** 2) for i in (1, 2, 3))
366 ((i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c")))
367 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
373 "ended_at": now() + timedelta(days=10),
375 "import_session_id": 1,
383 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
386 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
389 result = session.query(models.Customer.id).filter(
390 models.Customer.account_id == account_id, models.Customer.email == email_address
392 models.Customer.id.asc()
395 authors.łukasz.say_thanks()
397 A: 0.25 * (10.0 / 12),
398 B: 0.1 * (10.0 / 12),
399 C: 0.1 * (10.0 / 12),
400 D: 0.1 * (10.0 / 12),
405 yield from outside_of_generator
411 await some.complicated[0].call(with_args=(True or (1 is not 1)))
415 print(**{1: 3} if False else {x: x for x in range(3)})
417 for (x,) in (1,), (2,), (3,):
421 for z in (i for i in (1, 2, 3)):
425 for j in 1 + (2 + 3):
430 threading.current_thread() != threading.main_thread()
431 and threading.current_thread() != threading.main_thread()
432 or signal.getsignal(signal.SIGINT) != signal.default_int_handler
437 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
438 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
443 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
444 & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
449 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
450 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
455 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
456 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
461 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
462 * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
467 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
468 / aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
473 # standalone comment at ENDMARKER