Shellarium Public Beta is here! Try the AI Agent Orchestrator
← Back to list
Python Annotations

Python Annotations

Smart Code Inspections for Python Type Annotations Simplify, modernize, and validate your Python type hints with 21 intelligent inspections and one-click quick fixes...

Description

Smart Code Inspections for Python Type Annotations

Simplify, modernize, and validate your Python type hints with 21 intelligent inspections and one-click quick fixes.

Union & Optional Simplification

  • Union[int, None]Optional[int]
  • Union[X, object]object
  • Union[X, Any]Any
  • Union[dict]dict
  • Optional[Optional[X]]Optional[X]
  • Union[int, int, str]Union[int, str] (remove duplicates)
  • Union[int, bool]int (bool is subtype of int)
  • Union[Union[A, B], C]Union[A, B, C] (flatten nested)
  • Detect invalid Union[]

Modern Pipe Syntax (Python 3.10+)

  • X | objectobject
  • X | AnyAny
  • (X | Y) | ZX | Y | Z
  • (X) | YX | Y

Syntax Conversion (disabled by default)

  • Modernization: Union[X, Y]X | Y, Optional[X]X | None
  • Backward compatibility: X | YUnion[X, Y]
  • PEP 585: List[int]list[int]
  • PEP 695: TypeAliastype statement

Advanced Inspections (disabled by default)

  • Missing Optional for parameters with None default
  • Simplify Callable[..., Any]Callable
  • Redundant Generic[T] in class definitions
  • Unbound TypeVar (used only once)
  • Protocol methods without type annotations

GitHub | Report Issue

User Reviews

Michal L
Michal L
Resolved

Please update plugin to 2021.1