[New-bugs-announce] [issue41260] datetime: strftime method takes different keyword argument: fmt (pure) or format (C)

Anthony Sottile report at bugs.python.org
Thu Jul 9 13:01:48 EDT 2020


New submission from Anthony Sottile <asottile at umich.edu>:

C:

https://github.com/python/cpython/blob/8b33961e4bc4020d8b2d5b949ad9d5c669300e89/Modules/_datetimemodule.c#L3183

pure python:

https://github.com/python/cpython/blob/8b33961e4bc4020d8b2d5b949ad9d5c669300e89/Lib/datetime.py#L927


this makes it difficult to properly type in mypy:

https://github.com/python/typeshed/blob/209b6bb127f61fe173a60776e23883ac450cf1c8/stdlib/2and3/datetime.pyi#L55

and calling with `.strftime(fmt=...)` or `.strftime(format=...)` is inconsistent

(that said, it should _probably_ be a positional-only argument)

----------
components: Extension Modules, Library (Lib)
messages: 373407
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: datetime: strftime method takes different keyword argument: fmt (pure) or format (C)
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41260>
_______________________________________


More information about the New-bugs-announce mailing list