• Home
  • Raw
  • Download

Lines Matching +full:- +full:eq

82         # bpo-39562: test that future flags and compiler flags doesn't clash
129 def f() -> {ann}:
131 def g(arg: {ann}) -> None:
133 async def f2() -> {ann}:
135 async def g2(arg: {ann}) -> None:
167 expected = annotation if not is_tuple else annotation[1:-1]
183 eq = self.assertAnnotationEqual
184 eq('...')
185 eq("'some_string'")
186 eq("u'some_string'")
187 eq("b'\\xa3'")
188 eq('Name')
189 eq('None')
190 eq('True')
191 eq('False')
192 eq('1')
193 eq('1.0')
194 eq('1j')
195 eq('True or False')
196 eq('True or False or None')
197 eq('True and False')
198 eq('True and False and None')
199 eq('Name1 and Name2 or Name3')
200 eq('Name1 and (Name2 or Name3)')
201 eq('Name1 or Name2 and Name3')
202 eq('(Name1 or Name2) and Name3')
203 eq('Name1 and Name2 or Name3 and Name4')
204 eq('Name1 or Name2 and Name3 or Name4')
205 eq('a + b + (c + d)')
206 eq('a * b * (c * d)')
207 eq('(a ** b) ** c ** d')
208 eq('v1 << 2')
209 eq('1 >> v2')
210 eq('1 % finished')
211 eq('1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8')
212 eq('not great')
213 eq('not not great')
214 eq('~great')
215 eq('+value')
216 eq('++value')
217 eq('-1')
218 eq('~int and not v1 ^ 123 + v2 | True')
219 eq('a + (not b)')
220 eq('lambda: None')
221 eq('lambda arg: None')
222 eq('lambda a=True: a')
223 eq('lambda a, b, c=True: a')
224 eq("lambda a, b, c=True, *, d=1 << v2, e='str': a")
225 eq("lambda a, b, c=True, *vararg, d, e='str', **kwargs: a + b")
226 eq("lambda a, /, b, c=True, *vararg, d, e='str', **kwargs: a + b")
227 eq('lambda x, /: x')
228 eq('lambda x=1, /: x')
229 eq('lambda x, /, y: x + y')
230 eq('lambda x=1, /, y=2: x + y')
231 eq('lambda x, /, y=1: x + y')
232 eq('lambda x, /, y=1, *, z=3: x + y + z')
233 eq('lambda x=1, /, y=2, *, z=3: x + y + z')
234 eq('lambda x=1, /, y=2, *, z: x + y + z')
235 eq('lambda x=1, y=2, z=3, /, w=4, *, l, l2: x + y + z + w + l + l2')
236 eq('lambda x=1, y=2, z=3, /, w=4, *, l, l2, **kwargs: x + y + z + w + l + l2')
237 eq('lambda x, /, y=1, *, z: x + y + z')
238 eq('lambda x: lambda y: x + y')
239 eq('1 if True else 2')
240 eq('str or None if int or True else str or bytes or None')
241 eq('str or None if (1 if True else 2) else str or bytes or None')
242 eq("0 if not x else 1 if x > 0 else -1")
243 eq("(1 if x > 0 else -1) if x else 0")
244 eq("{'2.7': dead, '3.7': long_live or die_hard}")
245 eq("{'2.7': dead, '3.7': long_live or die_hard, **{'3.6': verygood}}")
246 eq("{**a, **b, **c}")
247 eq("{'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}")
248 eq("{*a, *b, *c}")
249 eq("({'a': 'b'}, True or False, +value, 'string', b'bytes') or None")
250 eq("()")
251 eq("(a,)")
252 eq("(a, b)")
253 eq("(a, b, c)")
254 eq("(*a, *b, *c)")
255 eq("[]")
256 eq("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]")
257 eq("[*a, *b, *c]")
258 eq("{i for i in (1, 2, 3)}")
259 eq("{i ** 2 for i in (1, 2, 3)}")
260 eq("{i ** 2 for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}")
261 eq("{i ** 2 + j for i in (1, 2, 3) for j in (1, 2, 3)}")
262 eq("[i for i in (1, 2, 3)]")
263 eq("[i ** 2 for i in (1, 2, 3)]")
264 eq("[i ** 2 for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]")
265 eq("[i ** 2 + j for i in (1, 2, 3) for j in (1, 2, 3)]")
266 eq("(i for i in (1, 2, 3))")
267 eq("(i ** 2 for i in (1, 2, 3))")
268 eq("(i ** 2 for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))")
269 eq("(i ** 2 + j for i in (1, 2, 3) for j in (1, 2, 3))")
270 eq("{i: 0 for i in (1, 2, 3)}")
271 eq("{i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}")
272 eq("[(x, y) for x, y in (a, b)]")
273 eq("[(x,) for x, in (a,)]")
274 eq("Python3 > Python2 > COBOL")
275 eq("Life is Life")
276 eq("call()")
277 eq("call(arg)")
278 eq("call(kwarg='hey')")
279 eq("call(arg, kwarg='hey')")
280 eq("call(arg, *args, another, kwarg='hey')")
281 eq("call(arg, another, kwarg='hey', **kwargs, kwarg2='ho')")
282 eq("lukasz.langa.pl")
283 eq("call.me(maybe)")
284 eq("1 .real")
285 eq("1.0.real")
286 eq("....__class__")
287 eq("list[str]")
288 eq("dict[str, int]")
289 eq("set[str,]")
290 eq("tuple[str, ...]")
291 eq("tuple[(str, *types)]")
292 eq("tuple[str, int, (str, int)]")
293 eq("tuple[(*int, str, str, (str, int))]")
294 eq("tuple[str, int, float, dict[str, int]]")
295 eq("slice[0]")
296 eq("slice[0:1]")
297 eq("slice[0:1:2]")
298 eq("slice[:]")
299 eq("slice[:-1]")
300 eq("slice[1:]")
301 eq("slice[::-1]")
302 eq("slice[:,]")
303 eq("slice[1:2,]")
304 eq("slice[1:2:3,]")
305 eq("slice[1:2, 1]")
306 eq("slice[1:2, 2, 3]")
307 eq("slice[()]")
308 eq("slice[a, b:c, d:e:f]")
309 eq("slice[(x for x in a)]")
310 eq('str or None if sys.version_info[0] > (3,) else str or bytes or None')
311 eq("f'f-string without formatted values is just a string'")
312 eq("f'{{NOT a formatted value}}'")
313 eq("f'some f-string with {a} {few():.2f} {formatted.values!r}'")
314 eq('''f"{f'{nested} inner'} outer"''')
315 eq("f'space between opening braces: { {a for a in (1, 2, 3)}}'")
316 eq("f'{(lambda x: x)}'")
317 eq("f'{(None if a else lambda x: x)}'")
318 eq("f'{x}'")
319 eq("f'{x!r}'")
320 eq("f'{x!a}'")
321 eq('[x for x in (a if b else c)]')
322 eq('[x for x in a if (b if c else d)]')
323 eq('f(x for x in a)')
324 eq('f(1, (x for x in a))')
325 eq('f((x for x in a), 2)')
326 eq('(((a)))', 'a')
327 eq('(((a, b)))', '(a, b)')
328 eq("1 + 2 + 3")
331 # f-strings with '=' don't round trip very well, so set the expected
345 self.assertAnnotationEqual("-1e1000", expected=f"-{inf}")
389 self._exec_future("def test() -> (await y): pass")
392 self._exec_future("async def test() -> something((a := b)): pass")