Skip to content
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

ENH: Add annotations to 3 functions in np.core.function_base #17144

Merged
merged 10 commits into from
Sep 7, 2020

Conversation

BvB93
Copy link
Member

@BvB93 BvB93 commented Aug 23, 2020

This pull requests adds annotations to 3 functions in np.core.function_base:

  • linspace
  • logspace
  • geomspace

As the main __init__.pyi file in numpy is starting to get somewhat cluttered
the respective stubs have been defined for the relevant sub-module instead.

Secondly, the docstring of logspace has been updated in order to clarify that
its base parameter can be array_like; not just a float.

Bas van Beek added 2 commits August 23, 2020 15:51
`SupportsIndex` is apparently still missing from the typing-extensions 3.7.4.2 pypi release (see python/typing#749): manually define the protocol in the relevant stubs.
@BvB93
Copy link
Member Author

BvB93 commented Sep 1, 2020

A bit of context about the back-and-forth in 72e11d3, c9c44fd & 68832b3:

Typing-extensions 3.7.4.3 added a backport of the (in python 3.8 introduced) SupportsIndex protocol, but the necessary stub files are still missing from typeshed (python/typeshed#4442). So for the time being we'll have to define it ourselves.

I suspect that this minor inconvience will be fixed somewhere around the release of either mypy 0.783 or 0.784.

@mattip
Copy link
Member

mattip commented Sep 3, 2020

There are a number of PRs with the static typing tag (including this one) that seem ready. Who besides @BvB93 is reviewing these?

@rgommers
Copy link
Member

rgommers commented Sep 3, 2020

There are a number of PRs with the static typing tag (including this one) that seem ready. Who besides @BvB93 is reviewing these?

I'm trying to when I can, and I've merged some - but I'm pretty low on bandwidth.

@charris
Copy link
Member

charris commented Sep 7, 2020

@BvB93 Needs rebase.

@charris charris merged commit d15254d into numpy:master Sep 7, 2020
@charris
Copy link
Member

charris commented Sep 7, 2020

Thanks @BvB93 .

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.

None yet

5 participants