mirror of https://github.com/python/cpython
bpo-41260: C impl of datetime.date.strftime() takes different keyword arg (GH-21712)
This commit is contained in:
parent
3a803bcaac
commit
b1dcdefc3a
|
@ -1032,13 +1032,13 @@ class date:
|
|||
_MONTHNAMES[self._month],
|
||||
self._day, self._year)
|
||||
|
||||
def strftime(self, fmt):
|
||||
def strftime(self, format):
|
||||
"""
|
||||
Format using strftime().
|
||||
|
||||
Example: "%d/%m/%Y, %H:%M:%S"
|
||||
"""
|
||||
return _wrap_strftime(self, fmt, self.timetuple())
|
||||
return _wrap_strftime(self, format, self.timetuple())
|
||||
|
||||
def __format__(self, fmt):
|
||||
if not isinstance(fmt, str):
|
||||
|
|
|
@ -1489,6 +1489,9 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
|
|||
#check that this standard extension works
|
||||
t.strftime("%f")
|
||||
|
||||
# bpo-41260: The parameter was named "fmt" in the pure python impl.
|
||||
t.strftime(format="%f")
|
||||
|
||||
def test_strftime_trailing_percent(self):
|
||||
# bpo-35066: Make sure trailing '%' doesn't cause datetime's strftime to
|
||||
# complain. Different libcs have different handling of trailing
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Rename the *fmt* parameter of the pure Python implementation of
|
||||
:meth:`datetime.date.strftime` to *format*.
|
Loading…
Reference in New Issue