Home
last modified time | relevance | path

Searched refs:get_annotations (Results 1 – 6 of 6) sorted by relevance

/external/python/cpython3/Lib/test/
Dtest_inspect.py1309 self.assertEqual(inspect.get_annotations(foo), {'a': int, 'b': str})
1312 self.assertEqual(inspect.get_annotations(foo), {'a': 'foo', 'b': 'str'})
1314 …self.assertEqual(inspect.get_annotations(foo, eval_str=True, locals=locals()), {'a': foo, 'b': str…
1315 …self.assertEqual(inspect.get_annotations(foo, eval_str=True, globals=locals()), {'a': foo, 'b': st…
1318 self.assertEqual(inspect.get_annotations(isa), {'a': int, 'b': str})
1319 self.assertEqual(inspect.get_annotations(isa.MyClass), {'a': int, 'b': str})
1320 …self.assertEqual(inspect.get_annotations(isa.function), {'a': int, 'b': str, 'return': isa.MyClass…
1321 …self.assertEqual(inspect.get_annotations(isa.function2), {'a': int, 'b': 'str', 'c': isa.MyClass, …
1322 … self.assertEqual(inspect.get_annotations(isa.function3), {'a': 'int', 'b': 'str', 'c': 'MyClass'})
1323 self.assertEqual(inspect.get_annotations(inspect), {}) # inspect module has no annotations
[all …]
/external/python/cpython3/Doc/howto/
Dannotations.rst36 :func:`inspect.get_annotations`. In Python versions 3.10
42 If for some reason :func:`inspect.get_annotations` isn't
72 :func:`inspect.get_annotations`: you should use three-argument
128 call :func:`inspect.get_annotations` to do this work
132 you can't use :func:`inspect.get_annotations`, you'll need
134 implementation of :func:`inspect.get_annotations` in the
/external/python/cpython3/Doc/library/
Dinspect.rst591 :func:`inspect.get_annotations()`. The
593 into :func:`inspect.get_annotations()` when resolving the
594 annotations; see the documentation for :func:`inspect.get_annotations()`
1122 .. function:: get_annotations(obj, *, globals=None, locals=None, eval_str=False)
1129 Returns a dict. ``get_annotations()`` returns a new dict every time
1153 (Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()`
1154 raises an exception, it will unwind the stack past the ``get_annotations``
1171 Calling ``get_annotations`` is best practice for accessing the
/external/python/cpython3/Misc/NEWS.d/
D3.10.0b1.rst644 Add :func:`inspect.get_annotations`, which safely computes the annotations
647 about the object passed in. :func:`inspect.get_annotations` can also
651 :func:`inspect.from_function` now call :func:`inspect.get_annotations` to
/external/python/cpython3/Lib/
Dinspect.py66 def get_annotations(obj, *, globals=None, locals=None, eval_str=False): function
2303 annotations = get_annotations(func, globals=globals, locals=locals, eval_str=eval_str)
/external/python/cpython3/Doc/whatsnew/
D3.10.rst1200 Add :func:`inspect.get_annotations`, which safely computes the annotations
1203 it examines. :func:`inspect.get_annotations` can also correctly un-stringize
1204 stringized annotations. :func:`inspect.get_annotations` is now considered
1210 now call :func:`inspect.get_annotations` to retrieve annotations. This means