@@ -216,6 +216,7 @@ cdef inline bint _is_fixed_offset(object tz):
216
216
217
217
218
218
_zero_time = datetime_time(0 , 0 )
219
+ _no_input = object ()
219
220
220
221
# Python front end to C extension type _Timestamp
221
222
# This serves as the box for datetime64
@@ -230,7 +231,7 @@ class Timestamp(_Timestamp):
230
231
keyword.
231
232
232
233
Parameters
233
- -----------------
234
+ ----------
234
235
ts_input : datetime-like, str, int, float
235
236
Value to be converted to Timestamp
236
237
offset : str, DateOffset
@@ -240,7 +241,7 @@ class Timestamp(_Timestamp):
240
241
unit : string
241
242
numpy unit used for conversion, if ts_input is int or float
242
243
243
- The other two forms copy the parameters from datetime.datetime. They can
244
+ The other two forms mimic the parameters from datetime.datetime. They can
244
245
be passed by either position or keyword, but not both mixed together.
245
246
246
247
:func:`datetime.datetime` Parameters
@@ -310,7 +311,7 @@ class Timestamp(_Timestamp):
310
311
return cls (datetime.combine(date, time))
311
312
312
313
def __new__ (cls ,
313
- object ts_input = None , object offset = None , tz = None , unit = None ,
314
+ object ts_input = _no_input , object offset = None , tz = None , unit = None ,
314
315
year = None , month = None , day = None ,
315
316
hour = None , minute = None , second = None , microsecond = None ,
316
317
tzinfo = None ):
@@ -328,14 +329,14 @@ class Timestamp(_Timestamp):
328
329
# that the second argument is an int.
329
330
# - Nones for the first four (legacy) arguments indicate pydatetime
330
331
# keyword arguments. year, month, and day are required. As a
331
- # shortcut, we just check that the first argument is None .
332
+ # shortcut, we just check that the first argument was not passed .
332
333
#
333
334
# Mixing pydatetime positional and keyword arguments is forbidden!
334
335
335
336
cdef _TSObject ts
336
337
cdef _Timestamp ts_base
337
338
338
- if ts_input is None :
339
+ if ts_input is _no_input :
339
340
# User passed keyword arguments.
340
341
return Timestamp(datetime(year, month, day, hour or 0 ,
341
342
minute or 0 , second or 0 , microsecond or 0 , tzinfo),
0 commit comments