Title: Convert calendar constants to enums and add months · Issue #103636 · python/cpython · GitHub
Open Graph Title: Convert calendar constants to enums and add months · Issue #103636 · python/cpython
X Title: Convert calendar constants to enums and add months · Issue #103636 · python/cpython
Description: From this discuss thread: The calendar module already defines constants e.g. MONDAY (0), TUESDAY (1), etc. for the [days of the week] https://docs.python.org/3/library/calendar.html#calendar.MONDAY). Since these are likely to be commonly...
Open Graph Description: From this discuss thread: The calendar module already defines constants e.g. MONDAY (0), TUESDAY (1), etc. for the [days of the week] https://docs.python.org/3/library/calendar.html#calendar.MONDAY...
X Description: From this discuss thread: The calendar module already defines constants e.g. MONDAY (0), TUESDAY (1), etc. for the [days of the week] https://docs.python.org/3/library/calendar.html#calendar.MONDAY...
Opengraph URL: https://github.com/python/cpython/issues/103636
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Convert calendar constants to enums and add months","articleBody":"From [this discuss thread](https://discuss.python.org/t/define-constants-for-month-numbers-in-calendar-module/25999?u=stoneleaf):\r\n\u003eThe `calendar` module already defines constants e.g. `MONDAY` (0), `TUESDAY` (1), etc. for the [days of the week] https://docs.python.org/3/library/calendar.html#calendar.MONDAY).\r\n\u003e\r\n\u003eSince 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)?\r\n\u003e\r\n\u003eThis would allow one to write `from calendar import APRIL` and then e.g. use `APRIL` instead of `4` when building a `datetime.date` object.\r\n\u003e\r\n\u003e Related: [datetime - Python module defining constants for month numbers? - Stack Overflow ](https://stackoverflow.com/q/76028482/359178)\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-103642\n* gh-103833\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ethanfurman","@type":"Person","name":"ethanfurman"},"datePublished":"2023-04-19T21:02:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/103636/cpython/issues/103636"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b5385e21-253f-155c-8542-fe8df2c9529b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 96E0:60C6C:1025392:157CC0B:696992B6 |
| html-safe-nonce | e0a3f5145881ce1f3129343b1f8e17cb3f539f5574110c3a8409b04d750242d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkUwOjYwQzZDOjEwMjUzOTI6MTU3Q0MwQjo2OTY5OTJCNiIsInZpc2l0b3JfaWQiOiI2MjMyODk4NDMzNTcxNjAxMTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 59af08c712b87b943a1a7fef35fa949d8a8fea33579128018bfbc428b83fba2e |
| hovercard-subject-tag | issue:1675629942 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/103636/issue_layout |
| twitter:image | https://opengraph.githubassets.com/406a48d8ecbf994e20276b6d66110131cd56a60f0e0331b4848734b621b082cd/python/cpython/issues/103636 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/406a48d8ecbf994e20276b6d66110131cd56a60f0e0331b4848734b621b082cd/python/cpython/issues/103636 |
| og:image:alt | From this discuss thread: The calendar module already defines constants e.g. MONDAY (0), TUESDAY (1), etc. for the [days of the week] https://docs.python.org/3/library/calendar.html#calendar.MONDAY... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ethanfurman |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width