Skip to content

minor cleanup: dict .update({x: y}) calls with a single item dict literal #136839

@gpshead

Description

@gpshead

@disconnect3d was analyzing stdlib code and noted several places with an old code pattern of a dict's .update method being called with a single element dict literal d.update({key: value}) instead of just d[key] = value assignment. see PR which cleans these up. #136811

It avoids an unnecessary temporary dict and method call, less awkward code.

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibPython modules in the Lib dirtype-refactorCode refactoring (with no changes in behavior)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions