Skip to content

Modernize type hints in ai/ module to Python 3.12+ syntax #46

@davidpoblador

Description

@davidpoblador

Summary

The ai module uses legacy typing import that can be replaced with Python 3.12+ built-in syntax.

File to update

  • src/blogtuner/ai/llm.py

Current import

from typing import Optional

Proposed change

Remove the typing import entirely and replace all Optional[X] with X | None.

Example

# Before
from typing import Optional
additional_info: Optional[str] = None

# After
additional_info: str | None = None

Priority

Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions