Home
last modified time | relevance | path

Searched refs:__annotations__ (Results 1 – 25 of 36) sorted by relevance

12

/external/python/cpython3/Lib/test/
Dmod_generics_cache.py29 __annotations__ = dict( variable
40 __annotations__ = dict( variable in A
49 __annotations__ = dict( variable in B
Dtest_grammar.py312 self.assertEqual(f.__annotations__, {})
336 self.assertEqual(C.__annotations__, {'_C__foo': int, 's': str})
352 self.assertEqual(CC.__annotations__['xx'], 'ANNOT')
356 print(test.__annotations__)
357 self.assertEqual(ann_module.__annotations__,
359 self.assertEqual(ann_module.M.__annotations__,
361 self.assertEqual(ann_module2.__annotations__, {})
584 self.assertEqual(f.__annotations__, {'return': list})
586 self.assertEqual(f.__annotations__, {'x': int})
588 self.assertEqual(f.__annotations__, {'x': str})
[all …]
Dann_module.py10 __annotations__[1] = 2
21 __annotations__['123'] = 123
Dtest_opcodes.py37 C.__annotations__
49 del __annotations__
Dann_module3.py7 __annotations__[1] = 2
Dann_module2.py25 __annotations__ = {} variable
Dtest_future.py123 func_ret_ann = scope['f'].__annotations__['return']
124 func_arg_ann = scope['g'].__annotations__['arg']
Dtest_dataclasses.py539 self.assertIn(f.name, C.__annotations__)
740 self.assertEqual(cls.__annotations__['i'], int)
741 self.assertEqual(cls.__annotations__['j'], str)
742 self.assertEqual(cls.__annotations__['k'], F)
743 self.assertEqual(cls.__annotations__['l'], float)
744 self.assertEqual(cls.__annotations__['z'], complex)
856 self.assertEqual(list(C.__annotations__), ['i'])
984 self.assertEqual(len(C.__annotations__), 6) # And 4 ClassVars.
1042 self.assertEqual(len(C.__annotations__), 5) # And 3 ClassVars
2994 self.assertEqual(C.__annotations__, {'x': 'typing.Any',
[all …]
Dtest_typing.py1866 testf.__annotations__['x'] = 'int'
1875 b.__annotations__ = {'x': 'A'}
2458 self.assertEqual(Emp.__annotations__,
2460 self.assertIs(Emp._field_types, Emp.__annotations__)
2478 self.assertEqual(CoolEmployee.__annotations__,
2480 self.assertIs(CoolEmployee._field_types, CoolEmployee.__annotations__)
2532 self.assertEqual(LocalEmployee.__annotations__, dict(name=str, age=int))
2533 self.assertIs(LocalEmployee._field_types, LocalEmployee.__annotations__)
2556 a = stuff.__annotations__['a']
2564 a = stuff.__annotations__['a']
[all …]
Dtest_inspect.py829 self.assertEqual(test.__annotations__, spec.annotations)
833 self.assertEqual(test.__annotations__, spec.annotations)
2230 self.__annotations__ = func.__annotations__
2284 __annotations__ = func.__annotations__ variable in TestSignatureObject.test_signature_functionlike_class.funclike
Dtest_functools.py613 self.assertEqual(wrapper.__annotations__['a'], 'This is a new annotation')
614 self.assertNotIn('b', wrapper.__annotations__)
634 self.assertEqual(wrapper.__annotations__, {})
685 self.assertEqual(wrapper.__annotations__, {})
/external/python/cpython2/Lib/lib2to3/tests/data/
Dpy3_test_grammar.py297 self.assertEquals(f.__annotations__, {'return': list})
299 self.assertEquals(f.__annotations__, {'x': int})
301 self.assertEquals(f.__annotations__, {'x': str})
303 self.assertEquals(f.__annotations__, {'x': float})
305 self.assertEquals(f.__annotations__, {'y': 3})
307 self.assertEquals(f.__annotations__, {'b': 1, 'c': 2})
309 self.assertEquals(f.__annotations__,
313 self.assertEquals(f.__annotations__,
320 self.assertEquals(f.__annotations__, {'return': list})
/external/python/cpython3/Lib/lib2to3/tests/data/
Dpy3_test_grammar.py321 self.assertEquals(f.__annotations__, {'return': list})
323 self.assertEquals(f.__annotations__, {'x': int})
325 self.assertEquals(f.__annotations__, {'x': str})
327 self.assertEquals(f.__annotations__, {'x': float})
329 self.assertEquals(f.__annotations__, {'y': 3})
331 self.assertEquals(f.__annotations__, {'b': 1, 'c': 2})
333 self.assertEquals(f.__annotations__,
337 self.assertEquals(f.__annotations__,
344 self.assertEquals(f.__annotations__, {'return': list})
/external/python/cpython3/Lib/
Dreprlib.py31 wrapper.__annotations__ = getattr(user_function, '__annotations__', {})
Dtyping.py1330 nm_tpl.__annotations__ = nm_tpl._field_types = collections.OrderedDict(types)
1365 nm_tpl.__new__.__annotations__ = collections.OrderedDict(types)
Dinspect.py2138 annotations = func.__annotations__
/external/python/cpython3/Doc/library/
Dfunctools.rst405 function's ``__module__``, ``__name__``, ``__qualname__``, ``__annotations__``
430 Copying of the ``__annotations__`` attribute by default.
Dtyping.rst891 This is often the same as ``obj.__annotations__``. In addition,
896 a dictionary constructed by merging all the ``__annotations__`` along
Ddataclasses.rst338 mechanism for creating a new class with ``__annotations__`` can
/external/python/cpython3/Python/
Dcompile.c216 static PyObject *__doc__, *__annotations__; variable
314 if (!__annotations__) { in PyAST_CompileObject()
315 __annotations__ = PyUnicode_InternFromString("__annotations__"); in PyAST_CompileObject()
316 if (!__annotations__) in PyAST_CompileObject()
4724 ADDOP_NAME(c, LOAD_NAME, __annotations__, names); in compiler_annassign()
/external/python/mock/mock/tests/
Dtestpatch.py1873 self.assertEqual(foo.__annotations__, dict([('s', 1, )]))
1874 self.assertEqual(foo.__annotations__, dict())
/external/python/cpython3/Lib/unittest/test/testmock/
Dtestpatch.py1865 self.assertEqual(foo.__annotations__, dict([('s', 1, )]))
1866 self.assertEqual(foo.__annotations__, dict())
/external/python/cpython3/Doc/tutorial/
Dcontrolflow.rst685 :term:`Annotations <function annotation>` are stored in the :attr:`__annotations__`
695 ... print("Annotations:", f.__annotations__)
/external/python/cpython3/Doc/reference/
Ddatamodel.rst468 single: __annotations__ (function attribute)
519 | :attr:`__annotations__` | A dict containing annotations | Writable |
720 single: __annotations__ (module attribute)
725 unavailable; :attr:`__annotations__` (optional) is a dictionary containing
794 single: __annotations__ (class attribute)
801 or ``None`` if undefined; :attr:`__annotations__` (optional) is a dictionary
Dcompound_stmts.rst579 a dictionary keyed by the parameters' names in the :attr:`__annotations__`

12