Expand description
Parse Python stub syntax and generate PyFunctionInfo and MethodInfo
This module provides functionality to parse Python stub syntax (type hints) and convert them into Rust metadata structures for stub generation.
Re-exportsΒ§
pub use pyfunction::parse_python_function_stub;
pub use pymethods::parse_python_methods_stub;
ModulesΒ§
- pyfunction π
- Parse Python function stub syntax and generate PyFunctionInfo
- pymethods π
- Parse Python class method stub syntax and generate MethodInfo
FunctionsΒ§
- dedent π
- Remove common leading whitespace from all lines (similar to Pythonβs textwrap.dedent)
- expr_
to_ πtype_ string - Convert Python expression to type string
- expr_
to_ πtype_ string_ inner - Convert Python expression to type string with context
- extract_
args π - Extract arguments from function definition
- extract_
deprecated_ πfrom_ decorators - Extract deprecated decorator information if present
- extract_
docstring π - Extract docstring from function definition
- extract_
return_ πtype - Extract return type from function definition
- type_
annotation_ πto_ type_ override - Convert Python type annotation to TypeOrOverride