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
Refactoring DB Manager Plugin to use list comprehensions and generators #41153
Conversation
unrelated test failure |
continue | ||
ids.append(self.quoteId(i)) | ||
return u'.'.join(ids) | ||
return u'.'.join( |
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.
return u'.'.join( | |
return '.'.join( |
While reworking this, the u
prefix is no longer needed.
If this aims to modernize things, shouldn't we use the |
My nitpick was mostly for one line. Though I'm not sure if this refactoring gives any advantage or is mostly a matter of style change. But I highly dislike the |
Description
Within the DB Manager plugin, this PR replaces for loops with equivalent list comprehensions where possible, and some list comprehensions with generators. In two cases, I also squashed some conditionals together, and in one case I squashed dict population into the intial creation. This should make the altered methods somewhat faster.