-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
gui: Use comprehensions when initializing lists, dicts, and sets #4914
Conversation
…`dict.fromkeys` instead
For the remaining, i'll file them in later, it is getting late, and I'm not sure that I can create a PR that is completely free of conflicts for the PR grouping the context managers (analogous to #4908). There's also one for early exits (can be split in two: functions and loops, similar to #4910), and one more for the remaining of changes in gui (analogous to #4911). |
Tomorrow I also want to see how many wx.Dialogs that I can use a context manager to handle the dlg.Destroy cleanly in all cases (like the second example here: https://docs.wxpython.org/wx.Dialog.html#phoenix-title-modal-and-modeless). |
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.
Looks good. It is quite a sizeable change though, so I hope I did not overlook anything. I assume you leave the %-string formating for another round.
Yes, there's like 2400 UP031 and 382 UP032, so it's not really a good thing to shove into the rest. The PR for early exit is a bit harder to review, so I made sure to keep (manually replace) the empty lines to have a "landmark" |
Analogous to #4909, but for files in gui/
All combined changes come from this branch (where it gets rebased): https://github.com/echoix/grass/tree/pyrefact-gui (echoix#335)