JetBrains IDE Plugin

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. Union & Optional Simplification Union[int, None] → Optional[int]…

51.4KDownloads
4.4Rating
FreePricing

Free to install from JetBrains Marketplace.

What Python Annotations Does

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

Getting Started

  1. Open the plugin page on JetBrains Marketplace.
  2. Install it in a compatible IDE and restart if prompted.
  3. Open your project and follow the plugin's setup guidance.

Categories

inspection

User Reviews

Michal L
Michal L
Resolved

Please update plugin to 2021.1

Ready to try Python Annotations?

Free to install from JetBrains Marketplace.