Home
last modified time | relevance | path

Searched refs:__annotations__ (Results 1 – 25 of 43) 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.py339 self.assertEqual(f.__annotations__, {})
363 self.assertEqual(C.__annotations__, {'_C__foo': int, 's': str})
379 self.assertEqual(CC.__annotations__['xx'], 'ANNOT')
383 print(test.__annotations__)
384 self.assertEqual(ann_module.__annotations__,
386 self.assertEqual(ann_module.M.__annotations__,
388 self.assertEqual(ann_module2.__annotations__, {})
624 self.assertEqual(f.__annotations__, {'return': list})
626 self.assertEqual(f.__annotations__, {'x': int})
628 self.assertEqual(f.__annotations__, {'x': int})
[all …]
Dann_module.py11 __annotations__[1] = 2
22 __annotations__['123'] = 123
Dtest_future.py144 func_ret_ann = scope['f'].__annotations__['return']
145 func_arg_ann = scope['g'].__annotations__['arg']
146 async_func_ret_ann = scope['f2'].__annotations__['return']
147 async_func_arg_ann = scope['g2'].__annotations__['arg']
Dtest_opcodes.py37 C.__annotations__
49 del __annotations__
Dann_module3.py7 __annotations__[1] = 2
Dann_module2.py25 __annotations__ = {} variable
Dtest_positional_only_arg.py305 assert inner_has_pos_only().__annotations__ == {'x': int}
312 assert Something().method().__annotations__ == {'x': int}
320 assert multiple_levels().__annotations__ == {'x': int}
Dtest_dataclasses.py559 self.assertIn(f.name, C.__annotations__)
760 self.assertEqual(cls.__annotations__['i'], int)
761 self.assertEqual(cls.__annotations__['j'], str)
762 self.assertEqual(cls.__annotations__['k'], F)
763 self.assertEqual(cls.__annotations__['l'], float)
764 self.assertEqual(cls.__annotations__['z'], complex)
876 self.assertEqual(list(C.__annotations__), ['i'])
1004 self.assertEqual(len(C.__annotations__), 6) # And 4 ClassVars.
1062 self.assertEqual(len(C.__annotations__), 5) # And 3 ClassVars
3059 self.assertEqual(C.__annotations__, {'x': 'typing.Any',
[all …]
Dtest_typing.py2927 testf.__annotations__['x'] = 'int'
2936 b.__annotations__ = {'x': 'A'}
3667 self.assertEqual(Emp.__annotations__,
3686 self.assertEqual(CoolEmployee.__annotations__,
3700 self.assertEqual(CoolEmployeeWithDefault.__annotations__,
3741 self.assertEqual(LocalEmployee.__annotations__, dict(name=str, age=int))
3805 self.assertEqual(Emp.__annotations__, {'name': str, 'id': int})
3820 self.assertEqual(Emp.__annotations__, {'name': str, 'id': int})
3826 …self.assertEqual(TD.__annotations__, {'cls': type, 'self': object, 'typename': str, '_typename': i…
3868 self.assertEqual(LabelPoint2D.__annotations__, {'x': int, 'y': int, 'label': str})
[all …]
Dtest_inspect.py962 self.assertEqual(test.__annotations__, spec.annotations)
966 self.assertEqual(test.__annotations__, spec.annotations)
2419 self.__annotations__ = func.__annotations__
2473 __annotations__ = func.__annotations__ variable in TestSignatureObject.test_signature_functionlike_class.funclike
Dtest_functools.py634 self.assertEqual(wrapper.__annotations__['a'], 'This is a new annotation')
635 self.assertNotIn('b', wrapper.__annotations__)
655 self.assertEqual(wrapper.__annotations__, {})
706 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.py1799 nm_tpl.__annotations__ = nm_tpl.__new__.__annotations__ = types
1919 tp_dict.__annotations__ = annotations
/external/python/cpython3/Doc/library/
Dtyping.rst963 The resulting class has an extra attribute ``__annotations__`` giving a
990 The ``_field_types`` and ``__annotations__`` attributes are
995 standard ``__annotations__`` attribute which has the same information.
1029 The type info for introspection can be accessed via ``Point2D.__annotations__``
1664 This is often the same as ``obj.__annotations__``. In addition,
1669 a dictionary constructed by merging all the ``__annotations__`` along
1740 Instead, they are stored as strings in ``__annotations__``,
Dfunctools.rst569 function's ``__module__``, ``__name__``, ``__qualname__``, ``__annotations__``
594 Copying of the ``__annotations__`` attribute by default.
/external/python/mock/mock/tests/
Dtestpatch.py1858 self.assertEqual(foo.__annotations__, dict([('s', 1, )]))
1859 self.assertEqual(foo.__annotations__, dict())
/external/python/cpython3/Lib/unittest/test/testmock/
Dtestpatch.py1887 self.assertEqual(foo.__annotations__, dict([('s', 1, )]))
1888 self.assertEqual(foo.__annotations__, dict())
/external/python/cpython3/Python/
Dcompile.c226 static PyObject *__doc__, *__annotations__; variable
331 if (!__annotations__) { in PyAST_CompileObject()
332 __annotations__ = PyUnicode_InternFromString("__annotations__"); in PyAST_CompileObject()
333 if (!__annotations__) in PyAST_CompileObject()
5269 ADDOP_NAME(c, LOAD_NAME, __annotations__, names); in compiler_annassign()
/external/python/cpython3/Doc/tutorial/
Dcontrolflow.rst862 :term:`Annotations <function annotation>` are stored in the :attr:`__annotations__`
872 ... print("Annotations:", f.__annotations__)
/external/python/cpython3/Misc/NEWS.d/
D3.8.0a3.rst265 favor of the __annotations__ attribute which carried the same information.
/external/python/cpython3/Tools/c-analyzer/
DTODO214 Python/compile.c:__annotations__ static PyObject *__annotations__
514 Python/ceval.c:_PyEval_EvalFrameDefault():PyId___annotations__ _Py_IDENTIFIER(__annotations__)
/external/tensorflow/tensorflow/python/saved_model/
Dsave_test.py150 annotated_function.__annotations__ = {

12