Skip to content

use more performant and concise dict construction by using dict comprehensions #4410

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

Merged
merged 4 commits into from
Apr 3, 2024

Conversation

Flamefire
Copy link
Contributor

The pattern dict([(key, value) for key, value in (construction)]) is very verbose and creates an intermediate list of tuples. Replace by {key: value for key, value in (construction)} to let Python core handle it without unncessary intermediates.

The pattern `dict([(key, value) for key, value in (construction)])` is
very verbose and creates an intermediate list of tuples.
Replace by `{key: value for key, value in (construction)}` to let Python
core handle it without unncessary intermediates.
@Flamefire Flamefire force-pushed the cleanup-dict branch 3 times, most recently from b67d8dc to cf02d83 Compare December 21, 2023 15:16
@jfgrimm jfgrimm added this to the 4.x milestone Dec 26, 2023
@easybuilders easybuilders deleted a comment from boegelbot Jan 2, 2024
@easybuilders easybuilders deleted a comment from boegelbot Jan 2, 2024
@boegel boegel changed the title Use more performant and concease dict construction use more performant and concise dict construction Jan 3, 2024
@boegel boegel modified the milestones: 4.x, release after 4.9.0 Jan 3, 2024
@boegel boegel changed the title use more performant and concise dict construction use more performant and concise dict construction by using dict comprehensions Apr 3, 2024
@boegel boegel merged commit c3563c4 into easybuilders:develop Apr 3, 2024
@Flamefire Flamefire deleted the cleanup-dict branch April 4, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants