File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2288,9 +2288,14 @@ cdef class _Period(PeriodMixin):
2288
2288
return bool(is_leapyear(self.year ))
2289
2289
2290
2290
@classmethod
2291
- def now(cls , freq = None ):
2291
+ def now(cls , freq ):
2292
2292
"""
2293
2293
Return the period of now's date.
2294
+
2295
+ Parameters
2296
+ ----------
2297
+ freq : str, BaseOffset
2298
+ Frequency to use for the returned period.
2294
2299
"""
2295
2300
return Period(datetime.now(), freq = freq)
2296
2301
Original file line number Diff line number Diff line change @@ -76,6 +76,13 @@ def test_construction(self):
76
76
assert i1 == i2
77
77
assert i1 == i3
78
78
79
+ i1 = Period .now ("D" )
80
+ i2 = Period (datetime .now (), freq = "D" )
81
+ i3 = Period .now (offsets .Day ())
82
+
83
+ assert i1 == i2
84
+ assert i1 == i3
85
+
79
86
i1 = Period ("1982" , freq = "min" )
80
87
i2 = Period ("1982" , freq = "MIN" )
81
88
assert i1 == i2
You can’t perform that action at this time.
0 commit comments