Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: replace integer value for month with constants #13547

Open
hofrob opened this issue Sep 28, 2024 · 0 comments
Open

Idea: replace integer value for month with constants #13547

hofrob opened this issue Sep 28, 2024 · 0 comments
Labels
needs-decision Awaiting a decision from a maintainer rule Implementing or modifying a lint rule

Comments

@hofrob
Copy link

hofrob commented Sep 28, 2024

calendar package

Python 3.12 added constants to the calendar package: https://docs.python.org/3.12/library/calendar.html#calendar.JANUARY

ruff should be able to find and replace integer values for the datetime.datetime or datetime.date constructor (and maybe others) with the corresponding constants.

weekday

There are also constants for weekdays. But I haven't thought where this could be useful (and easy to find/autofix).

@AlexWaygood AlexWaygood added rule Implementing or modifying a lint rule needs-decision Awaiting a decision from a maintainer labels Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Awaiting a decision from a maintainer rule Implementing or modifying a lint rule
Projects
None yet
Development

No branches or pull requests

2 participants