Skip to content

Cleanup use of dicts, e.g. use of .keys()#5165

Open
Flamefire wants to merge 1 commit intoeasybuilders:developfrom
Flamefire:cleanup-dicts
Open

Cleanup use of dicts, e.g. use of .keys()#5165
Flamefire wants to merge 1 commit intoeasybuilders:developfrom
Flamefire:cleanup-dicts

Conversation

@Flamefire
Copy link
Copy Markdown
Contributor

Using x in dict.keys() is discouraged and should be x in dict directly which is potentially more performant and easier to read/shorter. Accesses to keys and their values should use dict.items to avoid the lookup overhead.

@Flamefire Flamefire force-pushed the cleanup-dicts branch 2 times, most recently from efc69aa to e3683a6 Compare April 10, 2026 15:25
Using `x in dict.keys()` is discouraged and should be `x in dict`
directly which is potentially more performant and easier to read/shorter.
Accesses to keys and their values should use `dict.items` to avoid the
lookup overhead.
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.

1 participant