Skip to content

Some small fixes to function signatures to make them valid Python #174

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 3 commits into from
Apr 27, 2021

Conversation

asmeurer
Copy link
Member

No description provided.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks Aaron!

@@ -290,7 +290,7 @@ Returns evenly spaced numbers over a specified interval.
- a one-dimensional array containing evenly spaced values.

(function-meshgrid)=
### meshgrid(*arrays, /, *, indexing='xy')
### meshgrid(*arrays, indexing='xy')
Copy link
Member

Choose a reason for hiding this comment

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

I tried, that's indeed a syntax error otherwise - mildly surprised.

Copy link
Member

Choose a reason for hiding this comment

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

>>> x = y = np.arange(2)
>>> np.meshgrid(x, y, 'ij')
[array([[[0],
        [1]],

       [[0],
        [1]]]), array([[[0],
        [0]],

       [[1],
        [1]]]), array([[['ij'],
        ['ij']],

       [['ij'],
        ['ij']]], dtype='<U2')]

:facepalm:

Copy link
Member Author

Choose a reason for hiding this comment

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

The way I remember is that *args and * are both basically the same thing. They both separate keyword only arguments. The * is just a version of *args that doesn't actually allow any additional positional arguments.

@rgommers rgommers merged commit ad3156d into data-apis:main Apr 27, 2021
@rgommers rgommers added the Maintenance Bug fix, typo fix, or general maintenance. label Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Bug fix, typo fix, or general maintenance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants