diff --git a/lib/StubGen/Converter.py b/lib/StubGen/Converter.py index d5a2e2e..f73afb6 100644 --- a/lib/StubGen/Converter.py +++ b/lib/StubGen/Converter.py @@ -677,6 +677,8 @@ class PythonToStubConverter: return annotation.id elif isinstance(annotation, ast.Attribute): if isinstance(annotation.value, ast.Name): + if annotation.value.id in ('t', 'c'): + return annotation.attr return f'{annotation.value.id}.{annotation.attr}' else: # 处理嵌套属性访问,如 attr.packed