python-pro
Installation
SKILL.md
Python Pro
Advanced Python patterns for production code.
Type Hints (3.12+)
from typing import TypeVar, Protocol, overload
from collections.abc import Callable, Sequence
# Generic function
T = TypeVar('T')
def first(items: Sequence[T]) -> T | None:
return items[0] if items else None
# Protocol (structural typing)
class Serializable(Protocol):
def to_dict(self) -> dict: ...