Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TYP: Various typing updates#30041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
charris merged 19 commits intonumpy:maintenance/2.3.xfromcharris:typing-updates
Oct 22, 2025

Conversation

@charris
Copy link
Member

No description provided.

jorenham reacted with thumbs up emoji
@charrischarris added 08 - BackportUsed to tag backport PRs 41 - Static typing labelsOct 21, 2025
@jorenham
Copy link
Member

I don't think we should backport600294e (#30041)

@github-actions

This comment has been minimized.

charrisand others added3 commitsOctober 21, 2025 10:42
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
@charris
Copy link
MemberAuthor

I am afraid your pushes got lost (again).

@jorenham
Copy link
Member

The mypy failures innumpy/typing/tests/data/reveal/numerictypes.pyi can be resolved by including that entire.pyi here.

But the mypy failure innumpy/typing/tests/data/fail/scalars.pyi can be resolved by removing the__new__ method fromclass flexible here:

numpy/numpy/__init__.pyi

Lines 5453 to 5455 in49e4e89

classflexible(_RealMixin,generic[_FlexibleItemT_co],Generic[_FlexibleItemT_co]):
@abstractmethod
def__new__(cls)->Self: ...

so that it's something like this:

classflexible(_RealMixin,generic[_FlexibleItemT_co],Generic[_FlexibleItemT_co]): ...# type: ignore[misc]

@jorenham
Copy link
Member

I am afraid your pushes got lost (again).

I did not push anything though

@github-actions

This comment has been minimized.

@jorenham
Copy link
Member

The pyspark primer diff originates fromthis line:

tmp_val=arg[np._NoValue]# type: ignore[attr-defined]

where arg is adict | pd.Series instance.

So the previousattr-defined error now turned into acall-overload error; that's all.

- Update numpy/__init__.pyi- Update numpy/_core/numerictypes.pyi
@github-actions

This comment has been minimized.

charrisand others added2 commitsOctober 21, 2025 11:41
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
@jorenham
Copy link
Member

The mypy failures innumpy/typing/tests/data/reveal/numerictypes.pyi can be resolved by including that entire.pyi here.

With this the last two failures should be taken care of

@github-actions

This comment has been minimized.

@github-actions
Copy link

Diff frommypy_primer, showing the effect of this PR on type check results on a corpus of open source code:

xarray (https://github.com/pydata/xarray)+ xarray/compat/npcompat.py: note: In function "isdtype":+ xarray/compat/npcompat.py:54: error: All conditional function variants must have identical signatures  [misc]+ xarray/compat/npcompat.py:54: note: Original:+ xarray/compat/npcompat.py:54: note:     def isdtype(dtype: dtype[Any] | type, kind: type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | tuple[type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None, ...]) -> bool+ xarray/compat/npcompat.py:54: note: Redefinition:+ xarray/compat/npcompat.py:54: note:     def isdtype(dtype: dtype[Any] | type[Any], kind: type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | tuple[type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None, ...]) -> bool- xarray/namedarray/dtypes.py: note: In function "maybe_promote":- xarray/namedarray/dtypes.py:86: error: Too many arguments for "generic"  [call-arg]spark (https://github.com/apache/spark)+ python/pyspark/pandas/series.py:1210: error: Unused "type: ignore" comment  [unused-ignore]+ python/pyspark/pandas/series.py:1210: error: No overload variant of "__getitem__" of "Series" matches argument type "_NoValueType"  [call-overload]+ python/pyspark/pandas/series.py:1210: note: Error code "call-overload" not covered by "type: ignore" comment+ python/pyspark/pandas/series.py:1210: note: Possible overload variants:+ python/pyspark/pandas/series.py:1210: note:     def __getitem__(self, list[str] | Index[Any] | Series[Any] | slice[Any, Any, Any] | Series[builtins.bool] | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | list[builtins.bool] | tuple[Hashable | slice[Any, Any, Any], ...], /) -> Series[Any]+ python/pyspark/pandas/series.py:1210: note:     def __getitem__(self, str | bytes | date | datetime | timedelta | <7 more items> | complex | integer[Any] | floating[Any] | complexfloating[Any, Any], /) -> Any+ python/pyspark/pandas/series.py:1212: error: Unused "type: ignore" comment  [unused-ignore]

Copy link
Member

@jorenhamjorenham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I went over it again, and I think it should be good to merge now.

@charrischarris merged commitb096d6e intonumpy:maintenance/2.3.xOct 22, 2025
76 checks passed
@charrischarris deleted the typing-updates branchOctober 22, 2025 00:02
@jorenham
Copy link
Member

Thanks@charris

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jorenhamjorenhamjorenham approved these changes

Assignees

No one assigned

Labels

08 - BackportUsed to tag backport PRs41 - Static typing

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@charris@jorenham

[8]ページ先頭

©2009-2025 Movatter.jp