Python Code Review with Modern Typing

Audit Python code for typing correctness under Python 3.12+ conventions.

7|1|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/jack-michaud/faire --skill python-code-review-with-modern-typing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Python Code Review with Modern Typing
Source: https://github.com/jack-michaud/faire/tree/main/jack-software/skills/code-review/python-code-review-types
Command: npx skills add https://github.com/jack-michaud/faire --skill python-code-review-with-modern-typing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides systematic Python code review focused on Python 3.12+ type annotations, enforcing built-in generic types and modern syntax while discouraging deprecated typing module usage.

Core Features & Use Cases

  • Audit type annotations on functions, methods, and class attributes
  • Enforce built-in generics (list, dict, set, tuple, type)
  • Flag use of typing.List/Dict/Optional and suggest modern equivalents
  • Integrate with static type checkers (e.g., mypy) to ensure strict typing

Quick Start

Run a type-annotation audit on the attached Python module to convert to built-in generics and modern syntax.

Frequently Asked Questions about Python Code Review with Modern Typing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Python type annotations to modern syntax for Python 3.12?

Modern Python 3.12 type annotations use built-in generic types (list, dict, set, tuple, type) instead of typing module imports, and the union operator | instead of Union or Optional. This Skill audits your code to flag deprecated typing imports and suggest their built-in equivalents, ensuring compliance with current Python conventions.

Can I enforce type annotations on all functions and class attributes in a code review?

Yes. This Skill systematically audits type annotations across function parameters, return types, methods, and class attributes, enforcing built-in generics and modern syntax while integrating with static type checkers like mypy for strict type checking validation.

What's the difference between typing.List and using list as a type annotation?

typing.List is deprecated in Python 3.12+; the built-in list type now supports generic syntax directly (list[int]) without imports. This Skill identifies and flags typing.List, typing.Dict, typing.Optional usage and recommends the modern built-in generic equivalents.

How do I migrate existing code from Optional[X] to X | None syntax?

Python 3.12 supports the union operator | for type alternatives, making Optional[X] equivalent to X | None. This Skill audits your annotations, flags the deprecated Optional pattern, and guides conversion to modern | syntax for cleaner, more readable type hints.

Does this work when refactoring legacy Python code to strict type checking?

Yes. This Skill is designed for refactoring existing code to modern typing standards and enforcing strict static type checking. It audits pull requests and new code against Python 3.12+ conventions, making it ideal for gradual migration of legacy codebases to strict typing.

What happens if my code imports from the typing module instead of using built-in generics?

This Skill flags typing module imports (typing.List, typing.Dict, typing.Optional, etc.) as deprecated under Python 3.12+ standards and rejects them during code review, recommending built-in generic equivalents and modern union syntax instead.