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 for np.core.arrayprint #18032

Merged
merged 5 commits into from
Dec 19, 2020
Merged

Conversation

BvB93
Copy link
Member

@BvB93 BvB93 commented Dec 19, 2020

Per the title: this PR adds annotations for all array-printing-related functions in np.core.arrayprint.

@charris continuing from #7859 (comment):
The signature of np.set_printoptions can quite easily be annotated as it turns out,
so annotations can definitely help here with aforementioned issue.

void: Callable[[void], str]
numpystr: Callable[[_CharLike], str]
object: Callable[[object], str]
str: Callable[[Any], str] # Unused but still present?
Copy link
Member Author

@BvB93 BvB93 Dec 19, 2020

Choose a reason for hiding this comment

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

The docstring of np.setprintoptions (doc) mentions an optional str key for the formatter dict, even though it has been non-functional for the past 8 years (see #459).

Can we just remove any mention of it, both here and in the docstring?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds fine to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done as of 82e5747.

Just to stress: the above-mentioned push does not deprecate anything,
it merely removes a few lines of unused code (and updates the docstring).

Bas van Beek and others added 2 commits December 19, 2020 15:41
It's been non-functional for the past 8 years (xref numpy#459)
Co-Authored-By: Eric Wieser <425260+eric-wieser@users.noreply.github.com>
@charris charris merged commit a138ec5 into numpy:master Dec 19, 2020
@charris
Copy link
Member

charris commented Dec 19, 2020

Thanks Bas.

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

4 participants