Skip to content

TYP: offsets.WeekOfMonth needs better typing #46908

@Dr-Irv

Description

@Dr-Irv

For @twoertwein

I was doing some work with frequencies and discovered pd.tseries.offsets.WeekOfMonth and then see that it is not typed correctly in pandas._libs.tseries.offsets.pyi . Constructor is:

def __init__(self, n=1, normalize=False, week=0, weekday=0)

Right now, it picks up the constructor for BaseOffset which is:

def __init__(self, n: int = ..., normalize: bool = ...) -> None: ...

I'm guessing there might be other classes in offsets.pyi that have issues like this, but I'm not sure.

Metadata

Metadata

Assignees

Labels

FrequencyDateOffsetsTypingtype 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