305 # If inadvertently passed a Timestamp object, use replace()
306 # to create a clone.
307 if isinstance(ts, cls):
308 return ts.replace()309
310 if not isinstance(ts, str):
311 raise TypeError(
262 # If inadvertently passed a Timestamp object, use replace()
263 # to create a clone.
264 if isinstance(ts, cls):
265 return ts.replace()266
267 if not isinstance(ts, str):
268 raise TypeError(
232 .. deprecated:: 8.0
233 Use :meth:`replace` method instead.
234 """
235 return self.replace()236
237 @classproperty
238 def ISO8601Format(cls) -> str: # noqa: N802
179 # why pytest in py35/py37 fails without this?
180 ts = cls._from_datetime(ts)
181
182 return ts183
184 @classmethod
185 def _from_posix(cls, timestr: str) -> Timestamp:
136 raise ValueError(
137 f'time data {timestr!r} does not match MW format.')
138
139 return cls.strptime(timestr, cls.mediawikiTSFormat)140
141 @classmethod
142 def _from_iso8601(cls, timestr: str) -> Timestamp:
The return type of this callable is different from what is defined in the type hint.