-
Notifications
You must be signed in to change notification settings - Fork 180
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
deterministic ordering for errors in __all__ #604
Conversation
@@ -992,7 +992,10 @@ def checkDeadScopes(self): | |||
|
|||
if all_binding: | |||
all_names = set(all_binding.names) | |||
undefined = all_names.difference(scope) | |||
undefined = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can drop all_names
or if the usage on L1026 is really that much faster just because it's a set in practice on real code-bases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I thought about this, but I don't really have a good way to profile this. I imagine it's not a significant difference to keep the original value as a list and just do in
against that (however it does appear to change this from O(N) + O(M)
to O(N * M)
where N is the number of imports and M is the number of items in __all__
Probably ok to just leave it since it keeps this change a little bit more minimal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking thought in-line
@sigmavirus24 while I have you, can you click disable in appveyor so we don't get the empty failure? |
Resolves #603
I couldn't figure out a way to test this that wasn't flakey and without writing a bunch of test infra to look at the actual messages (since they're all the same type)
Here's a demo of the fix however: