Torsten Wörtwein

Results 70 comments of Torsten Wörtwein

In quite a few cases, the code seems to explicitly test that weekday is between 0 and 6 (WeekOfMonthMixin, Week, WeekOfMonth).

`dict[str, str]` is not officially documented but `Iterable[str]` (excluding str itself) might be "array-like" and would allow `dict[str, Any]`.

> Btw. I have a potential workaround for the `Iterable[str]` vs `str`, but it's not sure if it will be accepted: [python/cpython#112319](https://github.com/python/cpython/issues/112319) In pandas we use https://github.com/python/typing/issues/256#issuecomment-1732414512 (but that is...

> And perhaps the pandas docs should be updated? Unless support for passing format string was supposed to have been removed? In the past, it [apparently did not work](https://stackoverflow.com/questions/34097038/issue-calling-to-string-with-float-format-on-pandas-dataframe). Since...

Thank you, @zmoon ! In that case, I would be inclined to not add `str` to the annotations.

Feel free to open also a new pandas issue to highlight the discrepancy with the extension types (and xref the existing issue about str/no str). edit: should we use the...

Based on your error, I assume you are using mypy, which makes me believe that the annotations that mypy are complaining about are from [pandas-stubs](https://github.com/pandas-dev/pandas-stubs) and not pandas (mypy does...

This seems to be a pandas-stubs issue: pandas does not have any annotations for `data` https://github.com/pandas-dev/pandas/blob/6a65c64e77d625f55f7b17e2a270014e5bd49e31/pandas/core/series.py#L383

> We need to know the version of the stubs that you have installed and a more complete example that runs. Can reproduce on main: ```py import datetime from pandas.tseries.offsets...

> I was using pylance to check types and the `date + BDay` stubs seems to be incorrect Technically it is correct because `pd.Timestamp` is a sub-class `issubclass(pd.Timestamp, datetime.date)` but...