Skip to content

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

Since 2026.04.05 · Maturity Stable · Issues PY-82966

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.
UserId = NewType("UserId", int)
AccountId = NewType("AccountId", int)

Type Editing

Strip signature type annotations

Since 2026.04.05 · Maturity Stable

Removes all type annotations from a function signature in one action.

How to invoke: Alt+Enter"BetterPy: Strip type annotations from signature"

def create_user(name: str, email: str, age: int) -> User:
    pass
def create_user(name, email, age):
    pass

Copy method annotations from parent

Since 2026.04.05 · Maturity Incubating

Copies type annotations from a parent method to its overrides.

How to invoke: Alt+Enter"BetterPy: Copy type annotations from parent"

class Base:
    def process(self, data: list[str]) -> bool:
        ...

class Child(Base):
    def process(self, data):
        ...
class Child(Base):
    def process(self, data: list[str]) -> bool:
        ...

Inspections & Quick Fixes

Missing |None annotation inspection

Since 2026.04.05 · Maturity Incubating · Issues PY-88504

Reports parameters with a None default value whose annotation is missing | None.

def fetch(url: str, timeout: int = None):  # ⚠ Missing | None
    pass
def fetch(url: str, timeout: int | None = None):
    pass

Overridden method missing type annotations inspection

Since 2026.04.05 · Maturity Incubating

Reports overrides missing type annotations that are present in parent methods.

class Base:
    def process(self, data: list[str]) -> bool: ...

class Child(Base):
    def process(self, data):  # ⚠ Missing annotations
        ...

Filtering

Type annotation usage filtering

Since 2026.04.05 · Maturity Incubating · Issues PY-56092

Filters out type annotation usages from Find Usages results, so you see only real code references.