-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: delay calls of array repr in getlimits #9113
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
Conversation
Yep, this fixes the circular import problem from #8983. I was just reading this code myself to see how to fix it. My thought was to delay creation of _KNOWN_TYPES = None
def _get_known_types():
global _KNOWN_TYPES
if _KNOWN_TYPES is not None:
return _KNOWN_TYPES
... (indented definition of _KNOWN_TYPES goes here ... but I haven't properly thought through all the performance implications that you probably know about. This PR looks good to me, let's just wait for tests to pass. |
The
(the other files in this directory which have such a clause work properly). |
Should be removed. Scripts cannot use |
Delay use of array repr until needed for string representations of the float info parameters. This is to allow getlimits to be imported early without pulling in too much of the repr machinery. See: numpy#8983 (comment)
Does not work, and shouldn't be there.
7db4cf1
to
c7db85e
Compare
Thanks Matthew. I expect we can do more in this regard, but this is a good start and fixes the immediate problem. |
Thanks for moving this one forward @charris, and thanks for the fix @matthew-brett |
Delay use of array repr until needed for string representations of the
float info parameters. This is to allow getlimits to be imported early
without pulling in too much of the repr machinery.
See: #8983 (comment)