Strip signature type annotations¶
Remove all type annotations from a function signature in one action. The function body stays unchanged, making this a focused cleanup tool for examples, dynamic APIs, or code that should not expose annotations.
How to invoke¶
Place the caret inside a typed function signature and use ⌥⏎ / Alt+Enter -> "Strip type annotations from signature".
Example¶
becomes:
What it supports¶
- Parameter annotations.
- Return annotations.
- Regular functions and methods.
- Preserving default values, decorators, parameter order, and the function body.
What it deliberately avoids¶
- Removing annotations outside the current function signature.
- Rewriting variable annotations in the body.
- Changing call sites.
- Files outside your own project sources.
Notes¶
- This action is intentionally narrow: it removes signature annotations only.
- The feature is gated by the Strip signature type annotations setting under Settings | BetterPy | Typing & Type Hints | Type Editing.