Skip to content

Improvements for type annotations #610

Description

@The-Compiler
  • Use Type Hinting Generics in Standard Collections (list, dict, type over typing.List etc.)
  • Use from __future__ import annotations
    • Use PEP 604: New Type Union Operator, i.e. TheType | None instead of Optional[TheType]
    • Use "bare" annotations for forward declarations instead of stringified ones
    • Configure ruff to enforce from __future__ import annotations on every file for consistency
  • Remove redundant type annotations from Sphinx docstrings (and possibly configure Sphinx to pick up the annotations, not sure what's needed for that nowadays)

Originally posted by @The-Compiler in #605 (review)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions