Skip to content
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

Update shortcuts.py #769

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

idiomaticrefactoring
Copy link

I refactored code with set comprehension which is more concise and efficient,how do think this change which has practical value?
refactoring code with set comprehension which is more concise and efficient

refactoring code with set comprehension which is more concise and efficient
@ad-m
Copy link
Member

ad-m commented Mar 19, 2022

Could you remove redundant line global_perms = set() too?

@idiomaticrefactoring
Copy link
Author

Okay, I remove the global_perms = set().

Comment on lines 555 to 556
for code in global_perms:
codenames.remove(code)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could also be pointed that this operation may be rewritted using set operators:

codenames = codenames - global_perms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants