We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9a9cafd commit f7bbff5Copy full SHA for f7bbff5
1 file changed
swig/python/codegen/__init__.py
@@ -42,12 +42,8 @@ def translate(function: Union[str, Callable]) -> str:
42
tree = ast.parse(function_source)
43
# Filter constants
44
module_members = inspect.getmembers(module);
45
- # Emulate inspect.get_annotations() (requires python 3.10+)
46
- module_annontations = {}
47
- for mem in module_members:
48
- if mem[0] == "__annotations__":
49
- module_annontations = mem[1]
50
- break
+ # Requires python 3.10+
+ module_annontations = inspect.get_annotations(module)
51
prepend_c_source = ""
52
# Find all annotated variables
53
for key, val in module_annontations.items():
0 commit comments