-
Notifications
You must be signed in to change notification settings - Fork 18
Import wildcard #86
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
Comments
I added the Go tests, waiting for review. |
@trotterdylan implemented all your suggestions. Thanks a lot for all the help, it's my first time coding in Go, but I'm learning. The last travis job failed inexplicably. Tests passed on linux, but failed on osx, in apparently a part of the code I did not touch. If it's not flakiness and it's because of my code, how can I investigate it? There are 2 more things I might have to do in terms of functionality. The second one is the exception raised if the frame Globals is not a dictionary. In Python you get a SystemError. Wondering if it's worth doing. |
Sorry for the delay in responding. I've been occupied with other things. Re: Travis failure: This looks like unrelated flakiness. I'm not sure what's up with that but don't worry about it for the purposes of this PR. Re: PySequence_GetItem: Good find. It looks like there's no specification that Given that CPython implicitly requires a "sequence" (i.e. a tuple or a list) we should probably require the same. From experimentation, it seems like it calls getitem on increasing values of an index until it gets an IndexError. So test.py:
It's very awkward behavior IMO, but we should replicate it as best we can. Re: Globals being not a dict: I don't think this can happen in our case because we're pulling globals from f.Globals() which returns a |
Sorry for not responding. I was away on a business trip, but I can start working on this again tomorrow.
Meanwhile, I will do more investigation then come up with a solution. |
CPython and Grumpy are a bit different in how getitem is implemented. Here's the CPython code: https://github.com/python/cpython/blob/2.7/Objects/abstract.c#L135 The difference stems from the fact that CPython has two different I suspect this is an optimization and I'm not convinced we need to make our implementation this complicated right now. If you just call GetItem() directly by passing increasing integer objects in, the behavior will be very close. The only difference is we'll get an |
Just a heads up: I've made some fairly significant changes to the import code that will conflict with your changes. It's probably worth reviewing google@b9a0c8a to get a sense of how this affects you. Let me know if you have any questions. |
Thanks for letting me know! |
Closing in favor of #80, the same code from @claudiu-coman refactored for the updated import machinery. Thanks for the PR. It was REALLY useful. |
google#263 opened on Feb 21, 2017 by @claudiu-coman
@trotterdylan thanks for suggesting doing everything in Go! Once I got familiar with the code, I managed to write the same functionality with so fewer lines. :D
I intentionally simplified the Python test since I will now be moving detailed checks to module_test.go. I'll start writing the test for LoadMembers.
I think it makes sense now to close google#254 in favor of this approach.
The text was updated successfully, but these errors were encountered: