diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2022-12-22 21:57:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-22 21:57:18 (GMT) |
commit | 9cdb6429971cd8b874ceaeeb04ae2ecdbba42bdb (patch) | |
tree | 255e47669a26bafdeea2dad4d38879e8ac12c191 /Lib/datetime.py | |
parent | 09edde95f4841d5dffa584b1c963eb7ceab3f16a (diff) | |
download | cpython-9cdb6429971cd8b874ceaeeb04ae2ecdbba42bdb.zip cpython-9cdb6429971cd8b874ceaeeb04ae2ecdbba42bdb.tar.gz cpython-9cdb6429971cd8b874ceaeeb04ae2ecdbba42bdb.tar.bz2 |
gh-85432: Harmonise parameter names between C and pure-Python implementations of `datetime.time.strftime`, `datetime.datetime.fromtimestamp` (#99993)
Diffstat (limited to 'Lib/datetime.py')
-rw-r--r-- | Lib/datetime.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/datetime.py b/Lib/datetime.py index 1b0c5cb..68746de 100644 --- a/Lib/datetime.py +++ b/Lib/datetime.py @@ -1553,8 +1553,7 @@ class time: except Exception: raise ValueError(f'Invalid isoformat string: {time_string!r}') - - def strftime(self, fmt): + def strftime(self, format): """Format using strftime(). The date part of the timestamp passed to underlying strftime should not be used. """ @@ -1563,7 +1562,7 @@ class time: timetuple = (1900, 1, 1, self._hour, self._minute, self._second, 0, 1, -1) - return _wrap_strftime(self, fmt, timetuple) + return _wrap_strftime(self, format, timetuple) def __format__(self, fmt): if not isinstance(fmt, str): @@ -1787,14 +1786,14 @@ class datetime(date): return result @classmethod - def fromtimestamp(cls, t, tz=None): + def fromtimestamp(cls, timestamp, tz=None): """Construct a datetime from a POSIX timestamp (like time.time()). A timezone info object may be passed in as well. """ _check_tzinfo_arg(tz) - return cls._fromtimestamp(t, tz is not None, tz) + return cls._fromtimestamp(timestamp, tz is not None, tz) @classmethod def utcfromtimestamp(cls, t): |