You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Convert calendar constants to enums and add months #103636
Since these are likely to be commonly needed too, would it make sense for the calendar module to also export constants for all of JANUARY (1), FEBRUARY (2), …, DECEMBER (12)?
This would allow one to write from calendar import APRIL and then e.g. use APRIL instead of 4 when building a datetime.date object.
Activity
Agent-Hellboy commentedon Apr 20, 2023
looks easy, I would like to raise a PR?
ethanfurman commentedon Apr 20, 2023
@Agent-Hellboy Please do!
Agent-Hellboy commentedon Apr 20, 2023
Sure😊
pythongh-103636: Convert Calander consts to enum and add consts for m…
pythongh-103636: Convert Calander consts to enum and add consts for m…
pythongh-103636: Convert Calander consts to enum and add consts for m…
pythongh-103636: Convert Calander consts to enum and add consts for m…
pythongh-103636: Convert Calander consts to enum and add consts for m…
pythongh-103636: Convert Calander consts to enum and add consts for m…
pythongh-103636: Convert Calander consts to enum and add consts for m…
Sergo2106 commentedon Apr 21, 2023
pythongh-103636: Convert Calander consts to enum and add consts for m…
gh-103636: add enums for days and months in calendar module (GH-103642)
ethanfurman commentedon Apr 25, 2023
Let's also add a module-level
__getattr__to provide theJanuaryandFebruaryconstants and issue a warning when that happens.Agent-Hellboy commentedon Apr 25, 2023
okay, I will create a PR
pythongh-103636: raise warning for January and February attribute
hugovk commentedon Apr 26, 2023
Let's also document the additions from #103642 at https://docs.python.org/3.12/library/calendar.html with a
.. versionadded:: 3.12, and also add to https://docs.python.org/3.12/whatsnew/3.12.html#improved-modulesgh-103636: issue warning for deprecated calendar constants (#103833)
hugovk commentedon Apr 29, 2023
I think we're all set here:
Thanks!
Merge branch 'main' into supermon