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.
2 +++ <stdin> (formatted)
18 ~int and not v1 ^ 123 + v2 | True
19 (~int) and (not ((v1 ^ (123 + v2)) | True))
20 -flags & ~ select.EPOLLIN and waiters.write_task is not None
21 +flags & ~select.EPOLLIN and waiters.write_task is not None
24 lambda a, b, c=True: a
25 -lambda a, b, c=True, *, d=(1 << v2), e='str': a
26 -lambda a, b, c=True, *vararg, d=(v1 << 2), e='str', **kwargs: a + b
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 manylambdas = lambda x=lambda y=lambda z=1: z: y(): x()
30 -foo = (lambda port_id, ignore_missing: {"port1": port1_resource, "port2": port2_resource}[port_id])
31 +foo = lambda port_id, ignore_missing: {
32 + "port1": port1_resource,
33 + "port2": port2_resource,
36 str or None if True else str or bytes or None
37 (str or None) if True else (str or bytes or None)
38 str or None if (1 if True else 2) else str or bytes or None
39 (str or None) if (1 if True else 2) else (str or bytes or None)
40 -((super_long_variable_name or None) if (1 if super_long_test_name else 2) else (str or bytes or None))
41 -{'2.7': dead, '3.7': (long_live or die_hard)}
42 -{'2.7': dead, '3.7': (long_live or die_hard), **{'3.6': verygood}}
44 + (super_long_variable_name or None)
45 + if (1 if super_long_test_name else 2)
46 + else (str or bytes or None)
48 +{"2.7": dead, "3.7": (long_live or die_hard)}
49 +{"2.7": dead, "3.7": (long_live or die_hard), **{"3.6": verygood}}
51 -{'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')}
52 -({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None
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
60 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
67 -[this_is_a_very_long_variable_which_will_force_a_delimiter_split, element, another, *more]
71 + this_is_a_very_long_variable_which_will_force_a_delimiter_split,
76 {i for i in (1, 2, 3)}
77 {(i ** 2) for i in (1, 2, 3)}
78 -{(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
79 +{(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))}
80 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
81 [i for i in (1, 2, 3)]
82 [(i ** 2) for i in (1, 2, 3)]
83 -[(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]
84 +[(i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c"))]
85 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
86 {i: 0 for i in (1, 2, 3)}
87 -{i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
88 +{i: j for i, j in ((1, "a"), (2, "b"), (3, "c"))}
89 {a: b * 2 for a, b in dictionary.items()}
90 {a: b * -2 for a, b in dictionary.items()}
91 -{k: v for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension}
94 + for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
96 Python3 > Python2 > COBOL
101 -call(arg, kwarg='hey')
102 -call(arg, another, kwarg='hey', **kwargs)
103 -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
105 +call(arg, kwarg="hey")
106 +call(arg, another, kwarg="hey", **kwargs)
108 + this_is_a_very_long_variable_which_will_force_a_delimiter_split,
113 +) # note: no trailing comma pre-3.6
115 call(a, *gidgets[:2])
116 call(**self.screen_kwargs)
117 call(b, **self.screen_kwargs)
125 -tuple[str, int, float, dict[str, int],]
126 +tuple[str, int, float, dict[str, int]]
127 very_long_variable_name_filters: t.List[
128 t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]],
132 @@ -124,107 +145,159 @@
137 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
138 -{'2.7': dead, '3.7': long_live or die_hard}
139 -{'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
140 +{"2.7": dead, "3.7": long_live or die_hard}
141 +{"2.7", "3.6", "3.7", "3.8", "3.9", "4.0" if gilectomy else "3.10"}
142 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
146 (i for i in (1, 2, 3))
147 ((i ** 2) for i in (1, 2, 3))
148 -((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
149 +((i ** 2) for i, _ in ((1, "a"), (2, "b"), (3, "c")))
150 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
152 -{"id": "1","type": "type","started_at": now(),"ended_at": now() + timedelta(days=10),"priority": 1,"import_session_id": 1,**kwargs}
156 + "started_at": now(),
157 + "ended_at": now() + timedelta(days=10),
159 + "import_session_id": 1,
168 -what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
169 -what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
170 -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()
171 +what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
174 +what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
178 + session.query(models.Customer.id)
180 + models.Customer.account_id == account_id, models.Customer.email == email_address
182 + .order_by(models.Customer.id.asc())
186 authors.łukasz.say_thanks()
188 A: 0.25 * (10.0 / 12),
189 B: 0.1 * (10.0 / 12),
190 C: 0.1 * (10.0 / 12),
191 D: 0.1 * (10.0 / 12),
196 yield from outside_of_generator
201 await some.complicated[0].call(with_args=(True or (1 is not 1)))
206 print(**{1: 3} if False else {x: x for x in range(3)})
207 -print(* lambda x: x)
208 -assert(not Test),("Short message")
209 -assert this is ComplexTest and not requirements.fit_in_a_single_line(force=False), "Short message"
210 -assert(((parens is TooMany)))
211 -for x, in (1,), (2,), (3,): ...
213 -for z in (i for i in (1, 2, 3)): ...
214 -for i in (call()): ...
215 -for j in (1 + (2 + 3)): ...
216 -while(this and that): ...
217 -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
218 -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
219 -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
220 -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
222 - threading.current_thread() != threading.main_thread() and
223 - threading.current_thread() != threading.main_thread() or
224 - signal.getsignal(signal.SIGINT) != signal.default_int_handler
228 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
229 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
233 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &
234 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
238 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
239 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
243 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -
244 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
248 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
249 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
253 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /
254 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
258 - ~ 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
262 - ~ 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
266 - ~ 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
268 +assert not Test, "Short message"
269 +assert this is ComplexTest and not requirements.fit_in_a_single_line(
272 +assert parens is TooMany
273 +for (x,) in (1,), (2,), (3,):
277 +for z in (i for i in (1, 2, 3)):
281 +for j in 1 + (2 + 3):
283 +while this and that:
286 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
287 + in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
290 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
291 + not in qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
294 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
295 + is qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
298 + aaaa.bbbb.cccc.dddd.eeee.ffff.gggg.hhhh.iiii.jjjj.kkkk.llll.mmmm.nnnn.oooo.pppp
299 + is not qqqq.rrrr.ssss.tttt.uuuu.vvvv.xxxx.yyyy.zzzz
302 + threading.current_thread() != threading.main_thread()
303 + and threading.current_thread() != threading.main_thread()
304 + or signal.getsignal(signal.SIGINT) != signal.default_int_handler
308 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
309 + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
313 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
314 + & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
318 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
319 + + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
323 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
324 + - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
328 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
329 + * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
333 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
334 + / aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
338 + ~aaaa.a + aaaa.b - aaaa.c * aaaa.d / aaaa.e
339 + | aaaa.f & aaaa.g % aaaa.h ^ aaaa.i << aaaa.k >> aaaa.l ** aaaa.m // aaaa.n
343 + ~aaaaaaaa.a + aaaaaaaa.b - aaaaaaaa.c @ aaaaaaaa.d / aaaaaaaa.e
344 + | aaaaaaaa.f & aaaaaaaa.g % aaaaaaaa.h
345 + ^ aaaaaaaa.i << aaaaaaaa.k >> aaaaaaaa.l ** aaaaaaaa.m // aaaaaaaa.n
349 + ~aaaaaaaaaaaaaaaa.a
350 + + aaaaaaaaaaaaaaaa.b
351 + - aaaaaaaaaaaaaaaa.c * aaaaaaaaaaaaaaaa.d @ aaaaaaaaaaaaaaaa.e
352 + | aaaaaaaaaaaaaaaa.f & aaaaaaaaaaaaaaaa.g % aaaaaaaaaaaaaaaa.h
353 + ^ aaaaaaaaaaaaaaaa.i
354 + << aaaaaaaaaaaaaaaa.k
355 + >> aaaaaaaaaaaaaaaa.l ** aaaaaaaaaaaaaaaa.m // aaaaaaaaaaaaaaaa.n
359 # standalone comment at ENDMARKER