MCPcopy Index your code
hub / github.com/RustPython/RustPython / nested

Function nested

Lib/test/typinganndata/ann_module695.py:48–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46
47
48def nested():
49 from types import SimpleNamespace
50 from typing import get_type_hints
51
52 Eggs = bytes
53 Spam = memoryview
54
55
56 class E[Eggs, **Spam]:
57 x: Eggs
58 y: Spam
59
60 def generic_method[Eggs, **Spam](self, x: Eggs, y: Spam): pass
61
62
63 def generic_function[Eggs, **Spam](x: Eggs, y: Spam): pass
64
65
66 return SimpleNamespace(
67 E=E,
68 hints_for_E=get_type_hints(E),
69 hints_for_E_meth=get_type_hints(E.generic_method),
70 generic_func=generic_function,
71 hints_for_generic_func=get_type_hints(generic_function)
72 )

Callers 3

test_origin_trackingMethod · 0.50
genMethod · 0.50

Calls 2

SimpleNamespaceFunction · 0.90
get_type_hintsFunction · 0.90

Tested by 3

test_origin_trackingMethod · 0.40
genMethod · 0.40