Skip to content

Typing cleanup #287

@lemon24

Description

@lemon24

Clean typing stuff. Might be able to use pyupgrade for this.

To do:

  • from __future__ import annotations (and the changes it enables)
  • don't depend on typing_extensions at runtime (example)
  • typing.Self (supported by mypy master, but not by 0.991)
  • show types for data objects in docs
  • move TagFilter, {Feed,Entry}Filter options to _storage (todo) no, used by _search as well, just remove todo
  • make DEFAULT_RESERVED_NAME_SCHEME public
  • move reader.core.*Hook to types

To not do:

  • Consolidate (public) aliases under reader.typing (Flask does it)?
    • No, reader.types is likely good enough (but maybe consolidate them in one place in the file).
  • import typing as t, import typing_extensions as te (Flask does it)?
    • Fewer imports, but makes code look kinda ugly.
    • Also,

      When adding types, the convention is to import types using the form from typing import Union (as opposed to doing just import typing or import typing as t or from typing import *).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions