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)
82 tuple[str, int, float, dict[str, int]]
90 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
91 f'f-string without formatted values is just a string'
92 f'{{NOT a formatted value}}'
93 f'some f-string with {a} {few():.2f} {formatted.values!r}'
94 f"{f'{nested} inner'} outer"
95 f'space between opening braces: { {a for a in (1, 2, 3)}}'
96 {'2.7': dead, '3.7': long_live or die_hard}
97 {'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
98 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
102 (i for i in (1, 2, 3))
103 ((i ** 2) for i in (1, 2, 3))
104 ((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
105 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
111 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove)
112 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove)
116 yield from outside_of_generator
121 await some.complicated[0].call(with_args=(True or (1 is not 1)))
138 True or False or None
140 True and False and None
141 (Name1 and Name2) or Name3
142 Name1 and Name2 or Name3
143 Name1 or (Name2 and Name3)
144 Name1 or Name2 and Name3
145 (Name1 and Name2) or (Name3 and Name4)
146 Name1 and Name2 or Name3 and Name4
147 Name1 or (Name2 and Name3) or Name4
148 Name1 or Name2 and Name3 or Name4
152 1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8
153 ((1 + v2) - (v3 * 4)) ^ (((5 ** v6) / 7) // 8)
158 ~int and not v1 ^ 123 + v2 | True
159 (~int) and (not ((v1 ^ (123 + v2)) | True))
160 flags & ~select.EPOLLIN and waiters.write_task is not None
163 lambda a, b, c=True: a
164 lambda a, b, c=True, *, d=(1 << v2), e='str': a
165 lambda a, b, c=True, *vararg, d=(v1 << 2), e='str', **kwargs: a + b
167 str or None if True else str or bytes or None
168 (str or None) if True else (str or bytes or None)
169 str or None if (1 if True else 2) else str or bytes or None
170 (str or None) if (1 if True else 2) else (str or bytes or None)
171 {'2.7': dead, '3.7': (long_live or die_hard)}
172 {'2.7': dead, '3.7': (long_live or die_hard), **{'3.6': verygood}}
174 {'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')}
175 ({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None
181 [1, 2, 3, 4, 5, 6, 7, 8, 9, (10 or A), (11 or B), (12 or C)]
182 {i for i in (1, 2, 3)}
183 {(i ** 2) for i in (1, 2, 3)}
184 {(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}
185 {((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)}
186 [i for i in (1, 2, 3)]
187 [(i ** 2) for i in (1, 2, 3)]
188 [(i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]
189 [((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3)]
190 {i: 0 for i in (1, 2, 3)}
191 {i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}
194 for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
196 Python3 > Python2 > COBOL
201 call(arg, kwarg='hey')
202 call(arg, another, kwarg='hey', **kwargs)
211 tuple[str, int, float, dict[str, int]]
219 (str or None) if (sys.version_info[0] > (3,)) else (str or bytes or None)
220 f'f-string without formatted values is just a string'
221 f'{{NOT a formatted value}}'
222 f'some f-string with {a} {few():.2f} {formatted.values!r}'
223 f"{f'{nested} inner'} outer"
224 f'space between opening braces: { {a for a in (1, 2, 3)}}'
225 {'2.7': dead, '3.7': long_live or die_hard}
226 {'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}
227 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]
231 (i for i in (1, 2, 3))
232 ((i ** 2) for i in (1, 2, 3))
233 ((i ** 2) for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))
234 (((i ** 2) + j) for i in (1, 2, 3) for j in (1, 2, 3))
240 what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(
243 what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(
249 yield from outside_of_generator
255 await some.complicated[0].call(with_args=(True or (1 is not 1)))