FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-41260: C impl of datetime.date.strftime() takes different keyword arg by ZackerySpytz · Pull Request #21712 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions Lib/datetime.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1032,13 +1032,13 @@ def ctime(self):
_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):
Expand Down
3 changes: 3 additions & 0 deletions Lib/test/datetimetester.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,9 @@ def test_strftime(self):
#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
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Rename the *fmt* parameter of the pure Python implementation of
:meth:`datetime.date.strftime` to *format*.

Back | FazBrowse Home | New Git URL