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

Appearance settings

TYP: Optional 2nd numpy.complexfloating type parameter #27420

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

jorenham
Copy link
Member

@jorenham jorenham commented Sep 18, 2024

This changes complexfloating[N1, N2] to complexfloating[N1, N2 = N1] (see PEP 696), so that static type-checkers will interpret complexfloating[N] as complexfloating[N, N].

The runtime behavior already allows for passing a single type-argument to complexfloating.


edit
Because of some mypy bug related to PEP 696, the complexfloating operator methods have inlined, which (how some reason) causes the bug to not be an issue anymore.

@charris
Copy link
Member

charris commented Sep 18, 2024

You need to avoid touching pythoncapi-compat. Either you are not based on current main or you did not run git submodule update.

@jorenham
Copy link
Member Author

jorenham commented Sep 18, 2024

@charris I honestly have no idea why this keeps happening... Perhaps some vscode plugin that's being "helpful" 🤷🏻‍♂️


edit:

I now suspect that it was indeed a missing git submodule update, combined with a spin mypy

@jorenham jorenham force-pushed the typing/complexfloating-optional-nbit2 branch from 6fb2354 to df80b37 Compare September 18, 2024 13:47
@charris
Copy link
Member

charris commented Sep 18, 2024

Just to note the pythoncapi-compat was updated yesterday, so that probably played a role.

@charris charris merged commit 88a649b into numpy:main Sep 18, 2024
67 checks passed
@charris
Copy link
Member

charris commented Sep 18, 2024

Thanks @jorenham .

@jorenham jorenham deleted the typing/complexfloating-optional-nbit2 branch September 19, 2024 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.