-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
datetime
supports non-int
arguments
#9902
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
Comments
I am ok with supporting it here, since the various date classes explicitly check for it. But nothing I find particularly important, unless someone explicitly asks for it. |
The proposed change SGTM too! |
I confirm that But, on the other hand: it is not documented and it is not tested. So, I think we should keep this open. If some real use-case needs this, I will send a PR. |
Our policy is to prefer following the implementation rather than the documentation: https://github.com/python/typeshed/blob/main/CONTRIBUTING.md#what-to-do-when-a-projects-documentation-and-implementation-disagree |
Ok, I will send a PR then 🚀 |
Resolved in #9915 |
While discussing python/cpython#102791 I've noticed that
datetime
's objects can support non-int
arguments:Technically it might be used with some libs/dsls like
datetime.datetime(year=Year(2023), month=Month(3), day=Day(2))
Should we use
SupportsIndex
there?The text was updated successfully, but these errors were encountered: