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
datetime, date and time: strftime method takes different keyword argument: fmt (pure) or format (C) #85432
Comments
C: cpython/Modules/_datetimemodule.c Line 3183 in 8b33961
pure python: Line 927 in 8b33961
this makes it difficult to properly type in mypy: and calling with (that said, it should _probably_ be a positional-only argument) |
I think a positional-only argument would be the best option if we could do it, but it would be a backwards-incompatible change and it's probably not worth the hassle. If anyone is using the keyword argument, they're probably using If anyone wants to make a PR I think we can fix this for 3.10, though unfortunately because it is an API change it can't be backported. I think in typeshed they can safely change from |
awesome, I'm going to work through this with someone in my discord as a demo / mentorship opportunity -- hope that's ok! |
Updating this issue to cover the problem in date, time and datetime. |
Ref python/typeshed#6317 for a discussion about this in typeshed. |
In addition to |
…mplementations of `datetime.time.strftime`, `datetime.datetime.fromtimestamp`
…mplementations of `datetime.time.strftime`, `datetime.datetime.fromtimestamp`
…ntations of `datetime.time.strftime`, `datetime.datetime.fromtimestamp` (#99993)
asottile mannequin commentedJul 9, 2020
•
edited by bedevere-bot
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
datetime.time.strftime
,datetime.datetime.fromtimestamp
#99993The text was updated successfully, but these errors were encountered: