Skip to content

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

Merged
charris merged 3 commits into
numpy:mainfrom
jorenham:typing/complexfloating-optional-nbit2
Sep 18, 2024
Merged

charris merged 3 commits into
numpy:mainfrom
jorenham:typing/complexfloating-optional-nbit2

Conversation

@jorenham

@jorenham jorenham commented Sep 18, 2024 •

Copy link
Copy Markdown
Member

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

charris commented Sep 18, 2024

Copy link
Copy Markdown
Member

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

@jorenham

jorenham commented Sep 18, 2024 •

Copy link
Copy Markdown
Member Author

@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

charris commented Sep 18, 2024

Copy link
Copy Markdown
Member

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
@charris

charris commented Sep 18, 2024

Copy link
Copy Markdown
Member

Thanks @jorenham .

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