Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Convert calendar constants to enums and add months #103636

Closed
Labels
3.12only security fixesstdlibPython modules in the Lib dirtype-featureA feature request or enhancement
@ethanfurman

Description

@ethanfurman

Fromthis discuss thread:

Thecalendar 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 needed too, would it make sense for the calendar module to also export constants for all ofJANUARY (1),FEBRUARY (2), …,DECEMBER (12)?

This would allow one to writefrom calendar import APRIL and then e.g. useAPRIL instead of4 when building adatetime.date object.

Related:datetime - Python module defining constants for month numbers? - Stack Overflow

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixesstdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp