Skip to content

Commit

Permalink
[Birthday] Cog model restructure
Browse files Browse the repository at this point in the history
Restructure cog `Birthday` according to #608. No
functional changes expected.

Command handlers that utilize the `MonthDayConverter` now perform a
"typing cast" to inform static type checkers that the birthday being
passed to the command handlers as `MonthDayConverter` will be
subsequently passed to the corresponding methods in `CommandsCore` as
type `datetime.datetime` instead of `MonthDayConverter`. Note that
Python typing cast does not change or restrict any functionalities
because it is only information to static type checkers.

`MonthDayConverter` now exposes the `InputType` and `OutputType` as type
aliases so that code utilizes the converted can be type-hinted better.

The birth year constant 2020 is moved to `constants.py` as
`DEFAULT_YEAR`.
  • Loading branch information
quachtridat committed Dec 11, 2023
1 parent 861ba9a commit 137ac58
Show file tree
Hide file tree
Showing 6 changed files with 974 additions and 827 deletions.
Loading

0 comments on commit 137ac58

Please sign in to comment.