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)]
73 -[this_is_a_very_long_variable_which_will_force_a_delimiter_split, element, another, *more]
85 + this_is_a_very_long_variable_which_will_force_a_delimiter_split,
90 {i for i in (1, 2, 3)}
91 {(i ** 2) for i in (1, 2, 3)}
92 -{(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
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) for i, _ in ((1, "a"), (2, "b"), (3, "c"))]
99 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
100 {i: 0 for i in (1, 2, 3)}
101 -{i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
102 +{i: j for i, j in ((1, "a"), (2, "b"), (3, "c"))}
103 {a: b * 2 for a, b in dictionary.items()}
104 {a: b * -2 for a, b in dictionary.items()}
105 -{k: v for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension}
108 + for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
110 Python3 > Python2 > COBOL
115 -call(arg, kwarg='hey')
116 -call(arg, another, kwarg='hey', **kwargs)
117 -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
119 +call(arg, kwarg="hey")
120 +call(arg, another, kwarg="hey", **kwargs)
122 + this_is_a_very_long_variable_which_will_force_a_delimiter_split,
127 +) # note: no trailing comma pre-3.6
129 call(a, *gidgets[:2])
130 call(**self.screen_kwargs)
131 call(b, **self.screen_kwargs)
139 +tuple[str, int, float, dict[str, int]]
141 - str, int, float, dict[str, int]
143 -tuple[str, int, float, dict[str, int],]
149 very_long_variable_name_filters: t.List[
150 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
152 xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
153 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
155 xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore
156 sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
158 -xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[
159 - ..., List[SomeClass]
160 -] = classmethod(sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)) # type: ignore
161 +xxxx_xxx_xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod(
162 + sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__)
169 @@ -137,113 +173,180 @@
174 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
175 -{'2.7': dead, '3.7': long_live or die_hard}
176 -{'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
177 +{"2.7": dead, "3.7": long_live or die_hard}
178 +{"2.7", "3.6", "3.7", "3.8", "3.9", "4.0" if gilectomy else "3.10"}
179 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
183 (i for i in (1, 2, 3))
184 ((i ** 2) for i in (1, 2, 3))
185 -((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
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))
189 -{"id": "1","type": "type","started_at": now(),"ended_at": now() + timedelta(days=10),"priority": 1,"import_session_id": 1,**kwargs}
193 + "started_at": now(),
194 + "ended_at": now() + timedelta(days=10),
196 + "import_session_id": 1,
207 -what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
208 -what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
209 -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()
210 -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()
211 +what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
214 +what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
218 + session.query(models.Customer.id)
220 + models.Customer.account_id == account_id, models.Customer.email == email_address
222 + .order_by(models.Customer.id.asc())
226 + session.query(models.Customer.id)
228 + models.Customer.account_id == account_id, models.Customer.email == email_address
231 + models.Customer.id.asc(),
236 authors.łukasz.say_thanks()
238 A: 0.25 * (10.0 / 12),
239 B: 0.1 * (10.0 / 12),
240 C: 0.1 * (10.0 / 12),
241 D: 0.1 * (10.0 / 12),
246 yield from outside_of_generator
256 await some.complicated[0].call(with_args=(True or (1 is not 1)))
261 print(**{1: 3} if False else {x: x for x in range(3)})
262 -print(* lambda x: x)
263 -assert(not Test),("Short message")
264 -assert this is ComplexTest and not requirements.fit_in_a_single_line(force=False), "Short message"
265 -assert(((parens is TooMany)))
266 -for x, in (1,), (2,), (3,): ...
268 -for z in (i for i in (1, 2, 3)): ...
269 -for i in (call()): ...
270 -for j in (1 + (2 + 3)): ...
271 -while(this and that): ...
272 -for addr_family, addr_type, addr_proto, addr_canonname, addr_sockaddr in socket.getaddrinfo('google.com', 'http'):
274 +assert not Test, "Short message"
275 +assert this is ComplexTest and not requirements.fit_in_a_single_line(
278 +assert parens is TooMany
279 +for (x,) in (1,), (2,), (3,):
283 +for z in (i for i in (1, 2, 3)):
287 +for j in 1 + (2 + 3):
289 +while this and that:
297 +) in socket.getaddrinfo("google.com", "http"):
299 -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
300 -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
301 -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
302 -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
304 - threading.current_thread() != threading.main_thread() and
305 - threading.current_thread() != threading.main_thread() or
306 - signal.getsignal(signal.SIGINT) != signal.default_int_handler
310 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
311 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
315 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &
316 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
320 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
321 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
325 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -
326 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
330 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
331 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
335 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /
336 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
340 - ~ 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
344 - ~ 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
348 - ~ 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
350 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
351 + in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
354 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
355 + not 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 + is 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 not qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
366 + threading.current_thread() != threading.main_thread()
367 + and threading.current_thread() != threading.main_thread()
368 + or signal.getsignal(signal.SIGINT) != signal.default_int_handler
372 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
373 + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
377 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
378 + & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
382 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
383 + + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
387 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
388 + - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
392 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
393 + * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
397 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
398 + / aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
402 + ~aaaa.a + aaaa.b - aaaa.c * aaaa.d / aaaa.e
403 + | aaaa.f & aaaa.g % aaaa.h ^ aaaa.i << aaaa.k >> aaaa.l ** aaaa.m // aaaa.n
407 + ~aaaaaaaa.a + aaaaaaaa.b - aaaaaaaa.c @ aaaaaaaa.d / aaaaaaaa.e
408 + | aaaaaaaa.f & aaaaaaaa.g % aaaaaaaa.h
409 + ^ aaaaaaaa.i << aaaaaaaa.k >> aaaaaaaa.l ** aaaaaaaa.m // aaaaaaaa.n
413 + ~aaaaaaaaaaaaaaaa.a
414 + + aaaaaaaaaaaaaaaa.b
415 + - aaaaaaaaaaaaaaaa.c * aaaaaaaaaaaaaaaa.d @ aaaaaaaaaaaaaaaa.e
416 + | aaaaaaaaaaaaaaaa.f & aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h
417 + ^ aaaaaaaaaaaaaaaa.i
418 + << aaaaaaaaaaaaaaaa.k
419 + >> aaaaaaaaaaaaaaaa.l ** aaaaaaaaaaaaaaaa.m // aaaaaaaaaaaaaaaa.n
423 # standalone comment at ENDMARKER