-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Use dict unpacking in idlelib #80586
Comments
Replace 3 occurrences of 'd = d1.copy(); d.update(d2)' pattern with 'd = {**d1, **d2}'. Also remove unnecessary imports and uses of __main__. |
It is not unnecessary. globals() is not the same as __main__.__dict__. It may be possible to use a ChainMap instead of merging dicts, but I do not think it matters. |
I hit merge before seeing your post here. I based the globals change on >>> import __main__
>>> __main__.__dict__ is globals()
True |
It is true only in the main script or REPL. But you executed that code in imported modules. |
You mean that the patch will execute the code in imported module where the two are not even equal. So I will revert the '__main__' changes. I found two differences in completion behavior with the patch. One is a failure that should work, another is a success that should fail. I will try to turn at least one of them into a new test that fails before the reversion and passes after. |
Also, __builtins__ is only a module, with a __dict__, in __main__. |
Immediate followup is bpo-30348, add autocomplete tests. At least one would have failed with the initial patch. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: