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.
1 --- [Deterministic header]
2 +++ [Deterministic header]
18 ~int and not v1 ^ 123 + v2 | True
19 (~int) and (not ((v1 ^ (123 + v2)) | True))
20 -+really ** -confusing ** ~operator ** -precedence
21 -flags & ~ select.EPOLLIN and waiters.write_task is not None
22 ++(really ** -(confusing ** ~(operator ** -precedence)))
23 +flags & ~select.EPOLLIN and waiters.write_task is not None
26 lambda a, b, c=True: a
27 -lambda a, b, c=True, *, d=(1 << v2), e='str': a
28 -lambda a, b, c=True, *vararg, d=(v1 << 2), e='str', **kwargs: a + b
29 +lambda a, b, c=True, *, d=(1 << v2), e="str": a
30 +lambda a, b, c=True, *vararg, d=(v1 << 2), e="str", **kwargs: a + b
31 manylambdas = lambda x=lambda y=lambda z=1: z: y(): x()
32 -foo = (lambda port_id, ignore_missing: {"port1": port1_resource, "port2": port2_resource}[port_id])
33 +foo = lambda port_id, ignore_missing: {
34 + "port1": port1_resource,
35 + "port2": port2_resource,
38 str or None if True else str or bytes or None
39 (str or None) if True else (str or bytes or None)
40 str or None if (1 if True else 2) else str or bytes or None
41 (str or None) if (1 if True else 2) else (str or bytes or None)
42 -((super_long_variable_name or None) if (1 if super_long_test_name else 2) else (str or bytes or None))
43 -{'2.7': dead, '3.7': (long_live or die_hard)}
44 -{'2.7': dead, '3.7': (long_live or die_hard), **{'3.6': verygood}}
46 + (super_long_variable_name or None)
47 + if (1 if super_long_test_name else 2)
48 + else (str or bytes or None)
50 +{"2.7": dead, "3.7": (long_live or die_hard)}
51 +{"2.7": dead, "3.7": (long_live or die_hard), **{"3.6": verygood}}
53 -{'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')}
54 -({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None
55 +{"2.7", "3.6", "3.7", "3.8", "3.9", ("4.0" if gilectomy else "3.10")}
56 +({"a": "b"}, (True or False), (+value), "string", b"bytes") or None
62 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
69 -[this_is_a_very_long_variable_which_will_force_a_delimiter_split, element, another, *more]
73 + this_is_a_very_long_variable_which_will_force_a_delimiter_split,
78 {i for i in (1, 2, 3)}
79 {(i ** 2) for i in (1, 2, 3)}
80 -{(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
81 +{(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))}
82 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
83 [i for i in (1, 2, 3)]
84 [(i ** 2) for i in (1, 2, 3)]
85 -[(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]
86 +[(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))]
87 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
88 {i: 0 for i in (1, 2, 3)}
89 -{i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
90 +{i: j for i, j in ((1, "a"), (2, "b"), (3, "c"))}
91 {a: b * 2 for a, b in dictionary.items()}
92 {a: b * -2 for a, b in dictionary.items()}
93 -{k: v for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension}
96 + for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
98 Python3 > Python2 > COBOL
103 -call(arg, kwarg='hey')
104 -call(arg, another, kwarg='hey', **kwargs)
105 -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
107 +call(arg, kwarg="hey")
108 +call(arg, another, kwarg="hey", **kwargs)
110 + this_is_a_very_long_variable_which_will_force_a_delimiter_split,
115 +) # note: no trailing comma pre-3.6
117 call(a, *gidgets[:2])
118 call(**self.screen_kwargs)
119 call(b, **self.screen_kwargs)
128 - str, int, float, dict[str, int]
130 +tuple[str, int, float, dict[str, int]]
131 tuple[str, int, float, dict[str, int],]
132 very_long_variable_name_filters: t.List[
133 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
135 xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
136 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
138 xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
139 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
141 -xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[
142 - ..., List[SomeClass]
143 -] = classmethod(sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)) # type: ignore
144 +xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod(
145 + sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
152 @@ -137,118 +156,197 @@
157 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
158 -{'2.7': dead, '3.7': long_live or die_hard}
159 -{'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
160 +{"2.7": dead, "3.7": long_live or die_hard}
161 +{"2.7", "3.6", "3.7", "3.8", "3.9", "4.0" if gilectomy else "3.10"}
162 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
166 (i for i in (1, 2, 3))
167 ((i ** 2) for i in (1, 2, 3))
168 -((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
169 +((i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c")))
170 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
172 -{"id": "1","type": "type","started_at": now(),"ended_at": now() + timedelta(days=10),"priority": 1,"import_session_id": 1,**kwargs}
176 + "started_at": now(),
177 + "ended_at": now() + timedelta(days=10),
179 + "import_session_id": 1,
190 -what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
191 -what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
192 -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()
193 -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()
194 +what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
197 +what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
201 + session.query(models.Customer.id)
203 + models.Customer.account_id == account_id, models.Customer.email == email_address
205 + .order_by(models.Customer.id.asc())
209 + session.query(models.Customer.id)
211 + models.Customer.account_id == account_id, models.Customer.email == email_address
213 + .order_by(models.Customer.id.asc())
217 authors.łukasz.say_thanks()
219 A: 0.25 * (10.0 / 12),
220 B: 0.1 * (10.0 / 12),
221 C: 0.1 * (10.0 / 12),
222 D: 0.1 * (10.0 / 12),
227 yield from outside_of_generator
237 await some.complicated[0].call(with_args=(True or (1 is not 1)))
242 print(**{1: 3} if False else {x: x for x in range(3)})
243 -print(* lambda x: x)
244 -assert(not Test),("Short message")
245 -assert this is ComplexTest and not requirements.fit_in_a_single_line(force=False), "Short message"
246 -assert(((parens is TooMany)))
247 -for x, in (1,), (2,), (3,): ...
249 -for z in (i for i in (1, 2, 3)): ...
250 -for i in (call()): ...
251 -for j in (1 + (2 + 3)): ...
252 -while(this and that): ...
253 -for addr_family, addr_type, addr_proto, addr_canonname, addr_sockaddr in socket.getaddrinfo('google.com', 'http'):
255 +assert not Test, "Short message"
256 +assert this is ComplexTest and not requirements.fit_in_a_single_line(
259 +assert parens is TooMany
260 +for (x,) in (1,), (2,), (3,):
264 +for z in (i for i in (1, 2, 3)):
268 +for j in 1 + (2 + 3):
270 +while this and that:
278 +) in socket.getaddrinfo("google.com", "http"):
280 -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
281 -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
282 -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
283 -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
285 - threading.current_thread() != threading.main_thread() and
286 - threading.current_thread() != threading.main_thread() or
287 - signal.getsignal(signal.SIGINT) != signal.default_int_handler
291 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
292 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
296 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &
297 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
301 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
302 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
306 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -
307 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
311 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
312 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
316 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /
317 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
321 - ~ 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
325 - ~ 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
329 - ~ 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
332 -aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaa * (aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa) / (aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa)
334 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
335 + in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
338 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
339 + not in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
342 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
343 + is qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
346 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
347 + is not qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
350 + threading.current_thread() != threading.main_thread()
351 + and threading.current_thread() != threading.main_thread()
352 + or signal.getsignal(signal.SIGINT) != signal.default_int_handler
356 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
357 + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
361 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
362 + & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
366 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
367 + + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
371 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
372 + - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
376 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
377 + * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
381 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
382 + / aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
386 + ~aaaa.a + aaaa.b - aaaa.c * aaaa.d / aaaa.e
387 + | aaaa.f & aaaa.g % aaaa.h ^ aaaa.i << aaaa.k >> aaaa.l ** aaaa.m // aaaa.n
391 + ~aaaaaaaa.a + aaaaaaaa.b - aaaaaaaa.c @ aaaaaaaa.d / aaaaaaaa.e
392 + | aaaaaaaa.f & aaaaaaaa.g % aaaaaaaa.h
393 + ^ aaaaaaaa.i << aaaaaaaa.k >> aaaaaaaa.l ** aaaaaaaa.m // aaaaaaaa.n
397 + ~aaaaaaaaaaaaaaaa.a
398 + + aaaaaaaaaaaaaaaa.b
399 + - aaaaaaaaaaaaaaaa.c * aaaaaaaaaaaaaaaa.d @ aaaaaaaaaaaaaaaa.e
400 + | aaaaaaaaaaaaaaaa.f & aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h
401 + ^ aaaaaaaaaaaaaaaa.i
402 + << aaaaaaaaaaaaaaaa.k
403 + >> aaaaaaaaaaaaaaaa.l ** aaaaaaaaaaaaaaaa.m // aaaaaaaaaaaaaaaa.n
410 + * (aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa)
411 + / (aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa)
413 aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa
414 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa >> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
416 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
417 + >> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
418 + << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
421 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ^bbbb.a & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
423 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
424 + ^ bbbb.a & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
425 + ^ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
428 # standalone comment at ENDMARKER