msg338643 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2019-03-23 05:43 |
Replace 3 occurrences of 'd = d1.copy(); d.update(d2)' pattern with 'd = {**d1, **d2}'. Also remove unnecessary imports and uses of __main__. |
|
|
msg338648 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2019-03-23 06:52 |
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. |
|
|
msg338655 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2019-03-23 07:50 |
New changeset 2b75155590eb42d25e474b776ee9fdcc4b3dc840 by Terry Jan Reedy in branch 'master': bpo-36405: Use dict unpacking in idlelib (#12507) https://github.com/python/cpython/commit/2b75155590eb42d25e474b776ee9fdcc4b3dc840 |
|
|
msg338656 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2019-03-23 07:55 |
I hit merge before seeing your post here. I based the globals change on >>> import __main__ >>> __main__.__dict__ is globals() True |
|
|
msg338657 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2019-03-23 08:01 |
It is true only in the main script or REPL. But you executed that code in imported modules. |
|
|
msg338659 - (view) |
Author: miss-islington (miss-islington) |
Date: 2019-03-23 08:08 |
New changeset 00986ec5530f004fca2c2675a822c73f06283bdf by Miss Islington (bot) in branch '3.7': bpo-36405: Use dict unpacking in idlelib (GH-12507) https://github.com/python/cpython/commit/00986ec5530f004fca2c2675a822c73f06283bdf |
|
|
msg338661 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2019-03-23 09:55 |
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. |
|
|
msg338702 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2019-03-23 21:36 |
Also, __builtins__ is only a module, with a __dict__, in __main__. |
|
|
msg338755 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2019-03-24 21:12 |
New changeset 0fe4513d9a5510ae91c0da7eb0433f79a6d4dda9 by Terry Jan Reedy in branch 'master': bpo-36405: IDLE - Restore __main__ and add tests (#12518) https://github.com/python/cpython/commit/0fe4513d9a5510ae91c0da7eb0433f79a6d4dda9 |
|
|
msg338757 - (view) |
Author: miss-islington (miss-islington) |
Date: 2019-03-24 21:32 |
New changeset 2b580146a53311e4202b0be63040740cdc01f1f5 by Miss Islington (bot) in branch '3.7': bpo-36405: IDLE - Restore __main__ and add tests (GH-12518) https://github.com/python/cpython/commit/2b580146a53311e4202b0be63040740cdc01f1f5 |
|
|
msg338765 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2019-03-24 23:10 |
Immediate followup is #30348, add autocomplete tests. At least one would have failed with the initial patch. |
|
|