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)]
79 -[this_is_a_very_long_variable_which_will_force_a_delimiter_split, element, another, *more]
83 + this_is_a_very_long_variable_which_will_force_a_delimiter_split,
88 {i for i in (1, 2, 3)}
89 -{(i ** 2) for i in (1, 2, 3)}
90 -{(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
91 -{((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
92 +{(i**2) for i in (1, 2, 3)}
93 +{(i**2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))}
94 +{((i**2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
95 [i for i in (1, 2, 3)]
96 -[(i ** 2) for i in (1, 2, 3)]
97 -[(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]
98 -[((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
99 +[(i**2) for i in (1, 2, 3)]
100 +[(i**2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))]
101 +[((i**2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
102 {i: 0 for i in (1, 2, 3)}
103 -{i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
104 +{i: j for i, j in ((1, "a"), (2, "b"), (3, "c"))}
105 {a: b * 2 for a, b in dictionary.items()}
106 {a: b * -2 for a, b in dictionary.items()}
107 -{k: v for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension}
110 + for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
112 Python3 > Python2 > COBOL
117 -call(arg, kwarg='hey')
118 -call(arg, another, kwarg='hey', **kwargs)
119 -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
121 +call(arg, kwarg="hey")
122 +call(arg, another, kwarg="hey", **kwargs)
124 + this_is_a_very_long_variable_which_will_force_a_delimiter_split,
129 +) # note: no trailing comma pre-3.6
131 call(a, *gidgets[:2])
132 call(**self.screen_kwargs)
133 call(b, **self.screen_kwargs)
145 - str, int, float, dict[str, int]
147 -tuple[str, int, float, dict[str, int],]
148 +tuple[str, int, float, dict[str, int]]
149 +tuple[str, int, float, dict[str, int]]
150 very_long_variable_name_filters: t.List[
151 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
153 xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
154 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
156 xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
157 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
159 -xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[
160 - ..., List[SomeClass]
161 -] = classmethod(sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)) # type: ignore
162 +xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod(
163 + sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
170 @@ -137,118 +156,197 @@
175 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
176 -{'2.7': dead, '3.7': long_live or die_hard}
177 -{'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
178 +{"2.7": dead, "3.7": long_live or die_hard}
179 +{"2.7", "3.6", "3.7", "3.8", "3.9", "4.0" if gilectomy else "3.10"}
180 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
184 (i for i in (1, 2, 3))
185 -((i ** 2) for i in (1, 2, 3))
186 -((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
187 -(((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
188 +((i**2) for i in (1, 2, 3))
189 +((i**2) for i, _ in ((1, "a"), (2, "b"), (3, "c")))
190 +(((i**2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
192 -{"id": "1","type": "type","started_at": now(),"ended_at": now() + timedelta(days=10),"priority": 1,"import_session_id": 1,**kwargs}
196 + "started_at": now(),
197 + "ended_at": now() + timedelta(days=10),
199 + "import_session_id": 1,
210 -what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
211 -what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
212 -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()
213 -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()
214 +what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
217 +what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
221 + session.query(models.Customer.id)
223 + models.Customer.account_id == account_id, models.Customer.email == email_address
225 + .order_by(models.Customer.id.asc())
229 + session.query(models.Customer.id)
231 + models.Customer.account_id == account_id, models.Customer.email == email_address
233 + .order_by(models.Customer.id.asc())
237 authors.łukasz.say_thanks()
239 A: 0.25 * (10.0 / 12),
240 B: 0.1 * (10.0 / 12),
241 C: 0.1 * (10.0 / 12),
242 D: 0.1 * (10.0 / 12),
247 yield from outside_of_generator
257 await some.complicated[0].call(with_args=(True or (1 is not 1)))
262 print(**{1: 3} if False else {x: x for x in range(3)})
263 -print(* lambda x: x)
264 -assert(not Test),("Short message")
265 -assert this is ComplexTest and not requirements.fit_in_a_single_line(force=False), "Short message"
266 -assert(((parens is TooMany)))
267 -for x, in (1,), (2,), (3,): ...
269 -for z in (i for i in (1, 2, 3)): ...
270 -for i in (call()): ...
271 -for j in (1 + (2 + 3)): ...
272 -while(this and that): ...
273 -for addr_family, addr_type, addr_proto, addr_canonname, addr_sockaddr in socket.getaddrinfo('google.com', 'http'):
275 +assert not Test, "Short message"
276 +assert this is ComplexTest and not requirements.fit_in_a_single_line(
279 +assert parens is TooMany
280 +for (x,) in (1,), (2,), (3,):
284 +for z in (i for i in (1, 2, 3)):
288 +for j in 1 + (2 + 3):
290 +while this and that:
298 +) in socket.getaddrinfo("google.com", "http"):
300 -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
301 -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
302 -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
303 -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
305 - threading.current_thread() != threading.main_thread() and
306 - threading.current_thread() != threading.main_thread() or
307 - signal.getsignal(signal.SIGINT) != signal.default_int_handler
311 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
312 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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d @ aaaaaaaaaaaaaaaa.e | aaaaaaaaaaaaaaaa.f & aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h ^ aaaaaaaaaaaaaaaa.i << aaaaaaaaaaaaaaaa.k >> aaaaaaaaaaaaaaaa.l ** aaaaaaaaaaaaaaaa.m // aaaaaaaaaaaaaaaa.n
352 -aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa - aaaaaaaaaaaaaaaa * (aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa) / (aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaa)
354 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
355 + in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
358 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
359 + not in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
362 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
363 + is qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
366 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
367 + is not qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
370 + threading.current_thread() != threading.main_thread()
371 + and threading.current_thread() != threading.main_thread()
372 + or signal.getsignal(signal.SIGINT) != signal.default_int_handler
376 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
377 + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
381 + aaaaaaaa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