Skip to content

Refactor: modernize type hints and remove unused typing imports - #2562

Merged
rolandgeider merged 1 commit into
wger-project:masterfrom
raultejada24:refactor-type-hints
Oct 27, 2026
Merged

rolandgeider merged 1 commit into
wger-project:masterfrom
raultejada24:refactor-type-hints

Conversation

@raultejada24

Copy link
Copy Markdown
Contributor

Proposed Changes

  • Modernized all Union[...] annotations to the X | Y syntax in wger/nutrition/helpers.py.
  • Removed the obsolete TODO and unused Union import from wger/nutrition/helpers.py.
  • Replaced Optional[...] annotations with X | None and removed the unused Optional import in wger/nutrition/dataclasses.py.
  • Replaced List[...] with built-in list[...] annotations and removed unused List imports in:
    • wger/manager/views/routine.py
    • wger/manager/models/slot.py
    • wger/manager/models/day.py

Related Issue(s)

Please check that the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Code has been formatted to avoid unnecessary diffs
  • If the feature is big enough or if there are manual steps needed (deployment
    changes etc.), write a small writeup in CHANGELOG.md

@rolandgeider
rolandgeider merged commit a841e51 into wger-project:master Oct 27, 2026
7 checks passed
@rolandgeider

Copy link
Copy Markdown
Member

thanks

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.

2 participants