Summary
The core module uses legacy typing imports that can be replaced with Python 3.12+ built-in syntax.
Files to update
src/blogtuner/core/post.py
src/blogtuner/core/blog.py
Current imports
from typing import Any, Dict, List, Optional, Self
Proposed changes
Replace:
Dict[str, Any] → dict[str, Any]
List[str] → list[str]
Optional[str] → str | None
- Keep
Self from typing (still required)
- Keep
Any from typing (still required)
Example change
# Before
from typing import Any, Dict, List, Optional, Self
DEFAULT_POST_METADATA: Dict[str, Any] = {}
# After
from typing import Any, Self
DEFAULT_POST_METADATA: dict[str, Any] = {}
Priority
Medium
Note
Self still requires import from typing module in Python 3.12+. The project already uses Self correctly.