Typing & Type Hints¶
BetterPy enhances PyCharm's type system support with smart wrapping/unwrapping intentions, completions driven by expected types, and convenient annotation editing tools.
Completions¶
NewType/TypeVar/ParamSpec reference & rename¶
Adds reference support for NewType, TypeVar, and ParamSpec name string literals, enabling navigation from the string to its usage sites. Renaming the variable also updates the name string literal automatically.
How to invoke:
- Ctrl + click on the name string in a
NewType("UserId", int)call to navigate. - Shift+F6 on the definition to rename — the string literal stays in sync.
Type Editing¶
Strip signature type annotations¶
Removes all type annotations from a function signature in one action.
How to invoke: Alt+Enter → "BetterPy: Strip type annotations from signature"
Copy method annotations from parent¶
Copies type annotations from a parent method to its overrides.
How to invoke: Alt+Enter → "BetterPy: Copy type annotations from parent"
Inspections & Quick Fixes¶
Missing |None annotation inspection¶
Reports parameters with a None default value whose annotation is missing | None.
Overridden method missing type annotations inspection¶
Reports overrides missing type annotations that are present in parent methods.
Filtering¶
Type annotation usage filtering¶
Filters out type annotation usages from Find Usages results, so you see only real code references.