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]
15 Name1 or (Name2 and Name3) or Name4
16 Name1 or Name2 and Name3 or Name4
20 -1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8
21 -((1 + v2) - (v3 * 4)) ^ (((5 ** v6) / 7) // 8)
22 +1 + v2 - v3 * 4 ^ 5**v6 / 7 // 8
23 +((1 + v2) - (v3 * 4)) ^ (((5**v6) / 7) // 8)
28 ~int and not v1 ^ 123 + v2 | True
29 (~int) and (not ((v1 ^ (123 + v2)) | True))
30 -+really ** -confusing ** ~operator ** -precedence
31 -flags & ~ select.EPOLLIN and waiters.write_task is not None
32 ++(really ** -(confusing ** ~(operator**-precedence)))
33 +flags & ~select.EPOLLIN and waiters.write_task is not None
36 lambda a, b, c=True: a
37 -lambda a, b, c=True, *, d=(1 << v2), e='str': a
38 -lambda a, b, c=True, *vararg, d=(v1 << 2), e='str', **kwargs: a + b
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])
43 +foo = lambda port_id, ignore_missing: {
44 + "port1": port1_resource,
45 + "port2": port2_resource,
48 str or None if True else str or bytes or None
49 (str or None) if True else (str or bytes or None)
50 str or None if (1 if True else 2) else str or bytes or None
51 (str or None) if (1 if True else 2) else (str or bytes or None)
52 -((super_long_variable_name or None) if (1 if super_long_test_name else 2) else (str or bytes or None))
53 -{'2.7': dead, '3.7': (long_live or die_hard)}
54 -{'2.7': dead, '3.7': (long_live or die_hard), **{'3.6': verygood}}
56 + (super_long_variable_name or None)
57 + if (1 if super_long_test_name else 2)
58 + else (str or bytes or None)
60 +{"2.7": dead, "3.7": (long_live or die_hard)}
61 +{"2.7": dead, "3.7": (long_live or die_hard), **{"3.6": verygood}}
63 -{'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')}
64 -({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None
65 +{"2.7", "3.6", "3.7", "3.8", "3.9", ("4.0" if gilectomy else "3.10")}
66 +({"a": "b"}, (True or False), (+value), "string", b"bytes") or None
72 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
83 -[this_is_a_very_long_variable_which_will_force_a_delimiter_split, element, another, *more]
95 + this_is_a_very_long_variable_which_will_force_a_delimiter_split,
100 {i for i in (1, 2, 3)}
101 -{(i ** 2) for i in (1, 2, 3)}
102 -{(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
103 -{((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
104 +{(i**2) for i in (1, 2, 3)}
105 +{(i**2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))}
106 +{((i**2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
107 [i for i in (1, 2, 3)]
108 -[(i ** 2) for i in (1, 2, 3)]
109 -[(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]
110 -[((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
111 +[(i**2) for i in (1, 2, 3)]
112 +[(i**2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))]
113 +[((i**2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
114 {i: 0 for i in (1, 2, 3)}
115 -{i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
116 +{i: j for i, j in ((1, "a"), (2, "b"), (3, "c"))}
117 {a: b * 2 for a, b in dictionary.items()}
118 {a: b * -2 for a, b in dictionary.items()}
119 -{k: v for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension}
122 + for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
124 Python3 > Python2 > COBOL
129 -call(arg, kwarg='hey')
130 -call(arg, another, kwarg='hey', **kwargs)
131 -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
133 +call(arg, kwarg="hey")
134 +call(arg, another, kwarg="hey", **kwargs)
136 + this_is_a_very_long_variable_which_will_force_a_delimiter_split,
141 +) # note: no trailing comma pre-3.6
143 call(a, *gidgets[:2])
144 call(**self.screen_kwargs)
145 call(b, **self.screen_kwargs)
156 +tuple[str, int, float, dict[str, int]]
158 - str, int, float, dict[str, int]
160 -tuple[str, int, float, dict[str, int],]
166 very_long_variable_name_filters: t.List[
167 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
169 xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
170 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
172 xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
173 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
175 -xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[
176 - ..., List[SomeClass]
177 -] = classmethod(sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)) # type: ignore
178 +xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod(
179 + sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
186 @@ -137,118 +173,199 @@
191 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
192 -{'2.7': dead, '3.7': long_live or die_hard}
193 -{'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
194 +{"2.7": dead, "3.7": long_live or die_hard}
195 +{"2.7", "3.6", "3.7", "3.8", "3.9", "4.0" if gilectomy else "3.10"}
196 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
200 (i for i in (1, 2, 3))
201 -((i ** 2) for i in (1, 2, 3))
202 -((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
203 -(((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
204 +((i**2) for i in (1, 2, 3))
205 +((i**2) for i, _ in ((1, "a"), (2, "b"), (3, "c")))
206 +(((i**2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
208 -{"id": "1","type": "type","started_at": now(),"ended_at": now() + timedelta(days=10),"priority": 1,"import_session_id": 1,**kwargs}
212 + "started_at": now(),
213 + "ended_at": now() + timedelta(days=10),
215 + "import_session_id": 1,
226 -what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
227 -what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
228 -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()
229 -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()
230 +what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
233 +what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
237 + session.query(models.Customer.id)
239 + models.Customer.account_id == account_id, models.Customer.email == email_address
241 + .order_by(models.Customer.id.asc())
245 + session.query(models.Customer.id)
247 + models.Customer.account_id == account_id, models.Customer.email == email_address
250 + models.Customer.id.asc(),
255 authors.łukasz.say_thanks()
257 A: 0.25 * (10.0 / 12),
258 B: 0.1 * (10.0 / 12),
259 C: 0.1 * (10.0 / 12),
260 D: 0.1 * (10.0 / 12),
265 yield from outside_of_generator
275 await some.complicated[0].call(with_args=(True or (1 is not 1)))
280 print(**{1: 3} if False else {x: x for x in range(3)})
281 -print(* lambda x: x)
282 -assert(not Test),("Short message")
283 -assert this is ComplexTest and not requirements.fit_in_a_single_line(force=False), "Short message"
284 -assert(((parens is TooMany)))
285 -for x, in (1,), (2,), (3,): ...
287 -for z in (i for i in (1, 2, 3)): ...
288 -for i in (call()): ...
289 -for j in (1 + (2 + 3)): ...
290 -while(this and that): ...
291 -for addr_family, addr_type, addr_proto, addr_canonname, addr_sockaddr in socket.getaddrinfo('google.com', 'http'):
293 +assert not Test, "Short message"
294 +assert this is ComplexTest and not requirements.fit_in_a_single_line(
297 +assert parens is TooMany
298 +for (x,) in (1,), (2,), (3,):
302 +for z in (i for i in (1, 2, 3)):
306 +for j in 1 + (2 + 3):
308 +while this and that:
316 +) in socket.getaddrinfo("google.com", "http"):
318 -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
319 -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
320 -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
321 -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
323 - threading.current_thread() != threading.main_thread() and
324 - threading.current_thread() != threading.main_thread() or
325 - signal.getsignal(signal.SIGINT) != signal.default_int_handler
329 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
330 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
334 - aaaaaaaaa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aaaaaaaaaaaa.f & aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h ^ aaaaaaaaaaaaaaaa.i << aaaaaaaaaaaaaaaa.k >> aaaaaaaaaaaaaaaa.l ** aaaaaaaaaaaaaaaa.m // aaaaaaaaaaaaaaaa.n
370 -aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaa * (aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa) / (aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa)
372 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
373 + in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
376 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
377 + not in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
380 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
381 + is qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
384 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
385 + is not qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
388 + threading.current_thread() != threading.main_thread()
389 + and threading.current_thread() != threading.main_thread()
390 + or signal.getsignal(signal.SIGINT) != signal.default_int_handler
394 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
395 + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
399 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
400 + & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
404 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
405 + + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
409 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
410 + - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
414 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
415 + * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
419 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
420 + / aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
424 + ~aaaa.a + aaaa.b - aaaa.c * aaaa.d / aaaa.e
425 + | aaaa.f & aaaa.g % aaaa.h ^ aaaa.i << aaaa.k >> aaaa.l**aaaa.m // aaaa.n
429 + ~aaaaaaaa.a + aaaaaaaa.b - aaaaaaaa.c @ aaaaaaaa.d / aaaaaaaa.e
430 + | aaaaaaaa.f & aaaaaaaa.g % aaaaaaaa.h
431 + ^ aaaaaaaa.i << aaaaaaaa.k >> aaaaaaaa.l**aaaaaaaa.m // aaaaaaaa.n
435 + ~aaaaaaaaaaaaaaaa.a
436 + + aaaaaaaaaaaaaaaa.b
437 + - aaaaaaaaaaaaaaaa.c * aaaaaaaaaaaaaaaa.d @ aaaaaaaaaaaaaaaa.e
438 + | aaaaaaaaaa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