Skip to content

DOC: should DateOffset always be used instead of BaseOffset? #60886

Closed
@MarcoGorelli

Description

@MarcoGorelli

There's currently 4 pages in the docs which mention BaseOffset:

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

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsTypingtype annotations, mypy/pyright type checking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions