Skip to content

MAINT: Move asarray helpers into their own module #13324

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 1 commit into from
Apr 14, 2019

Conversation

eric-wieser
Copy link
Member

This is a direct move, with some tweaks to imports.

This breaks a cyclic imports between core.numeric and core.fromnumeric.

This doesn't affect the value of np.core.numeric.__all__ which keeps code doing from numpy.core.numeric import * working.

Similar to #13322

from .multiarray import array


__all__ = [
Copy link
Member

Choose a reason for hiding this comment

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

I still prefer normal lists fromatting for this. This sort of works for a few entries, but I don't think it buys much over the usual left to right reading habit.

Copy link
Member Author

Choose a reason for hiding this comment

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

This sort of works for a few entries

That's a feature, it discourages too many items from being put in a single module ;)

@charris
Copy link
Member

charris commented Apr 14, 2019

LGTM, but I hope you aren't going to make a habit of the vertical __all__ lists.

@eric-wieser
Copy link
Member Author

So you mean, don't try to pull #9453 again?

Sure, I can change this and the other PR to put them on one line

This is a direct move, with some tweaks to imports.

This breaks a cyclic imports between `core.numeric` and `core.fromnumeric`.

This doesn't affect the value of `np.core.numeric.__all__` which keeps code doing `from numpy.core.numeric import *` working.
@charris
Copy link
Member

charris commented Apr 14, 2019

So you mean, don't try to pull #9453 again?

Just so :) I admit it is easier to alphabetize the vertical lists -- I convert back and forth when doing that -- but If it isn't too much bother I would prefer the usual.

@eric-wieser
Copy link
Member Author

I think logical grouping is probably more valuable than alphabetizing anyway.

I had a look through cpython for precedent, and the style is pretty mixed.

Once this goes in, I'll rebase #13322 and collapse the __all__ list there too

@eric-wieser
Copy link
Member Author

Looks like this caught the LGTM alerts already - I was expecting to have to merge the other PR for that to work...

@charris charris merged commit 396cc49 into numpy:master Apr 14, 2019
@charris
Copy link
Member

charris commented Apr 14, 2019

Thanks Eric.

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.

2 participants