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]→objectUnion[X, Any]→AnyUnion[dict]→dictOptional[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 | object→objectX | Any→Any(X | Y) | Z→X | Y | Z(X) | Y→X | Y
Syntax Conversion (disabled by default)
- Modernization:
Union[X, Y]→X | Y,Optional[X]→X | None - Backward compatibility:
X | Y→Union[X, Y] - PEP 585:
List[int]→list[int] - PEP 695:
TypeAlias→typestatement
Advanced Inspections (disabled by default)
- Missing
Optionalfor parameters withNonedefault - Simplify
Callable[..., Any]→Callable - Redundant
Generic[T]in class definitions - Unbound TypeVar (used only once)
- Protocol methods without type annotations
Getting Started
- Open the plugin page on JetBrains Marketplace.
- Install it in a compatible IDE and restart if prompted.
- Open your project and follow the plugin's setup guidance.
User Reviews
Resolved
Please update plugin to 2021.1
Ready to try Python Annotations?
Free to install from JetBrains Marketplace.