Skip to content

DOC: Document array_function at a higher level. #14058

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 6 commits into from
Jul 18, 2019

Conversation

charris
Copy link
Member

@charris charris commented Jul 18, 2019

Backport of #13979 .

Closes #13844

This PR adds a new document illustrating a very simple custom array container implementing __array_ufunc__ and __array_function__. It also rephrases the documentation on subclasses to direct users toward considering dispatch instead of inheritance.

Additional work is needed to restructure the documentation to make this new document easier for developers to discover and to provide more context about when to choose inheritance (rarely but sometimes still the right choice) or dispatch. I propose to defer that larger effort to a separate PR and get this published soon so that some high-level documentation on __array_function__ is at least available.

Feel free to take a heavy hand to this in reviewing/editing. I wrote this with the perspective of someone who has been following the __array_function__ conversation but has not thought deeply about the design.

@charris charris added this to the 1.16.5 release milestone Jul 18, 2019
@rgommers rgommers merged commit cd4bd94 into numpy:maintenance/1.16.x Jul 18, 2019
@charris charris deleted the backport-13979 branch July 19, 2019 01:30
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.

3 participants