Skip to content

chore: require Python 3.10 and modernise type hints#98

Merged
MikeWooster merged 2 commits into
masterfrom
chore/python-3.10-typing
Jun 7, 2026
Merged

chore: require Python 3.10 and modernise type hints#98
MikeWooster merged 2 commits into
masterfrom
chore/python-3.10-typing

Conversation

@MikeWooster

Copy link
Copy Markdown
Owner
  • Raises the minimum supported Python to 3.10 (now end-of-life on 3.9) so the codebase can use modern typing syntax everywhere.
  • Modernises type hints across the package: X | None instead of Optional, builtin generics (list/dict/tuple) instead of typing.List etc., and inlines the Optional* aliases

- raise the floor to Python 3.10 (setup.py, CI matrices, black target,
  CONTRIBUTING); 3.9 is end-of-life
- replace Optional[X]/Union[...] with X | None / X | Y throughout
- use builtin generics (list/dict/tuple/type) instead of typing.List etc
- drop the Optional* wrapper aliases from utils.typing and inline at use
  sites; keep the domain aliases (JsonType, BasicAuthType, XmlType,
  ResponseType), modernised
- fix retry_if_api_request_error status_codes default to list[int] | None
- add 'from __future__ import annotations' so annotations are lazy, then
  move every type-only import (BasicAuthType, JsonType, XmlType, Callable,
  Any, requests, and cross-module classes used only in hints) under
  TYPE_CHECKING
- omit the now runtime-dead utils/typing.py (pure type-alias module,
  imported only under TYPE_CHECKING) from coverage
- make paginated()'s callable args optional (Callable | None = None)
@MikeWooster MikeWooster merged commit ac0b14b into master Jun 7, 2026
7 checks passed
@MikeWooster MikeWooster deleted the chore/python-3.10-typing branch June 7, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant