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.
14 True and False and None
15 (Name1 and Name2) or Name3
16 Name1 and Name2 or Name3
17 Name1 or (Name2 and Name3)
18 Name1 or Name2 and Name3
19 (Name1 and Name2) or (Name3 and Name4)
20 Name1 and Name2 or Name3 and Name4
21 Name1 or (Name2 and Name3) or Name4
22 Name1 or Name2 and Name3 or Name4
26 1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8
27 ((1 + v2) - (v3 * 4)) ^ (((5 ** v6) / 7) // 8)
32 ~int and not v1 ^ 123 + v2 | True
33 (~int) and (not ((v1 ^ (123 + v2)) | True))
34 flags & ~ select.EPOLLIN and waiters.write_task is not None
37 lambda a, b, c=True: a
38 lambda a, b, c=True, *, d=(1 << v2), e='str': a
39 lambda a, b, c=True, *vararg, d=(v1 << 2), e='str', **kwargs: a + b
41 str or None if True else str or bytes or None
42 (str or None) if True else (str or bytes or None)
43 str or None if (1 if True else 2) else str or bytes or None
44 (str or None) if (1 if True else 2) else (str or bytes or None)
45 {'2.7': dead, '3.7': (long_live or die_hard)}
46 {'2.7': dead, '3.7': (long_live or die_hard), **{'3.6': verygood}}
48 {'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')}
49 ({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None
55 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
56 {i for i in (1, 2, 3)}
57 {(i ** 2) for i in (1, 2, 3)}
58 {(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
59 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
60 [i for i in (1, 2, 3)]
61 [(i ** 2) for i in (1, 2, 3)]
62 [(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]
63 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
64 {i: 0 for i in (1, 2, 3)}
65 {i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
66 {k: v for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension}
67 Python3 > Python2 > COBOL
72 call(arg, kwarg='hey')
73 call(arg, another, kwarg='hey', **kwargs)
74 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
84 tuple[str, int, float, dict[str, int]]
93 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
94 {'2.7': dead, '3.7': long_live or die_hard}
95 {'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
96 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
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))
110 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
111 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
112 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()
115 yield from outside_of_generator
119 await some.complicated[0].call(with_args=(True or (1 is not 1)))
122 threading.current_thread() != threading.main_thread() and
123 threading.current_thread() != threading.main_thread() or
124 signal.getsignal(signal.SIGINT) != signal.default_int_handler
128 # standalone comment at ENDMARKER
145 True or False or None
147 True and False and None
148 (Name1 and Name2) or Name3
149 Name1 and Name2 or Name3
150 Name1 or (Name2 and Name3)
151 Name1 or Name2 and Name3
152 (Name1 and Name2) or (Name3 and Name4)
153 Name1 and Name2 or Name3 and Name4
154 Name1 or (Name2 and Name3) or Name4
155 Name1 or Name2 and Name3 or Name4
159 1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8
160 ((1 + v2) - (v3 * 4)) ^ (((5 ** v6) / 7) // 8)
165 ~int and not v1 ^ 123 + v2 | True
166 (~int) and (not ((v1 ^ (123 + v2)) | True))
167 flags & ~select.EPOLLIN and waiters.write_task is not None
170 lambda a, b, c=True: a
171 lambda a, b, c=True, *, d=(1 << v2), e='str': a
172 lambda a, b, c=True, *vararg, d=(v1 << 2), e='str', **kwargs: a + b
174 str or None if True else str or bytes or None
175 (str or None) if True else (str or bytes or None)
176 str or None if (1 if True else 2) else str or bytes or None
177 (str or None) if (1 if True else 2) else (str or bytes or None)
178 {'2.7': dead, '3.7': (long_live or die_hard)}
179 {'2.7': dead, '3.7': (long_live or die_hard), **{'3.6': verygood}}
181 {'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')}
182 ({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None
188 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
189 {i for i in (1, 2, 3)}
190 {(i ** 2) for i in (1, 2, 3)}
191 {(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
192 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
193 [i for i in (1, 2, 3)]
194 [(i ** 2) for i in (1, 2, 3)]
195 [(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]
196 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
197 {i: 0 for i in (1, 2, 3)}
198 {i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
201 for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
203 Python3 > Python2 > COBOL
208 call(arg, kwarg='hey')
209 call(arg, another, kwarg='hey', **kwargs)
211 this_is_a_very_long_variable_which_will_force_a_delimiter_split,
216 ) # note: no trailing comma pre-3.6
226 tuple[str, int, float, dict[str, int]]
235 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
236 {'2.7': dead, '3.7': long_live or die_hard}
237 {'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
238 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
242 (i for i in (1, 2, 3))
243 ((i ** 2) for i in (1, 2, 3))
244 ((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
245 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
252 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
255 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
258 result = session.query(models.Customer.id).filter(
259 models.Customer.account_id == account_id, models.Customer.email == email_address
261 models.Customer.id.asc()
266 yield from outside_of_generator
272 await some.complicated[0].call(with_args=(True or (1 is not 1)))
276 threading.current_thread() != threading.main_thread()
277 and threading.current_thread() != threading.main_thread()
278 or signal.getsignal(signal.SIGINT) != signal.default_int_handler
283 # standalone comment at ENDMARKER