-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Closed
Labels
Description
There's currently 4 pages in the docs which mention BaseOffset:
- https://pandas.pydata.org/docs/reference/api/pandas.Period.asfreq.html
- https://pandas.pydata.org/docs/reference/api/pandas.Period.now.html
- https://pandas.pydata.org/docs/reference/api/pandas.tseries.frequencies.to_offset.html
However, BaseOffset
isn't user-facing
Should they just be replaced with DateOffset
?
This is also relevant for pandas-stubs
which uses BaseOffset
in a few places
@jbrockmendel is this ok to do?
Based on
pandas/pandas/_libs/tslibs/offsets.pyx
Lines 1620 to 1632 in 0c4ca3a
class OffsetMeta(type): | |
""" | |
Metaclass that allows us to pretend that all BaseOffset subclasses | |
inherit from DateOffset (which is needed for backward-compatibility). | |
""" | |
@classmethod | |
def __instancecheck__(cls, obj) -> bool: | |
return isinstance(obj, BaseOffset) | |
@classmethod | |
def __subclasscheck__(cls, obj) -> bool: | |
return issubclass(obj, BaseOffset) |
they should be interchangeable?