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 np.core.multiarray part 3/4 #19237

Merged
merged 6 commits into from
Jun 13, 2021

Conversation

BvB93
Copy link
Member

@BvB93 BvB93 commented Jun 13, 2021

The third part in a series of PRs for adding annotations to np.core.multiarray.

Pretty much all remaining (public) functions in the namespace are now annotated,
with the exception of nditer and nested_iters.

@@ -1280,7 +1280,7 @@

add_newdoc('numpy.core.multiarray', 'fromstring',
"""
fromstring(string, dtype=float, count=-1, sep='', *, like=None)
fromstring(string, dtype=float, count=-1, *, sep, like=None)
Copy link
Member Author

@BvB93 BvB93 Jun 13, 2021

Choose a reason for hiding this comment

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

fromstring is currently a bit of an odd one. It does have a default value for sep,
but it is deprecated, thus leaving us with a de facto mandatory parameter right in the middle of a function signature,
As a compromise I now documented it as a mandatory keyword-only parameter.

Any thoughts here?

Copy link
Member

@charris charris Jun 13, 2021

Choose a reason for hiding this comment

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

When was it deprecated?. Mandatory seems reasonable. Maybe it should get a better default value?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Mandatory seems reasonable. Maybe it should get a better default value?

I imagine that " " would be the most obvious candidate here.

@charris charris merged commit 923996a into numpy:main Jun 13, 2021
@charris
Copy link
Member

charris commented Jun 13, 2021

Thanks Bas.

@BvB93 BvB93 deleted the multiarray2 branch June 13, 2021 19:26
@BvB93 BvB93 changed the title ENH: Add annotations to np.core.multiarray part 3/4 ENH: Add annotations to np.core.multiarray part 3/4 Jun 13, 2021
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

2 participants