Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Lib/_collections_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,8 +967,8 @@ def update(self, other=(), /, **kwds):
In either case, this is followed by: for k, v in F.items(): D[k] = v
'''
if isinstance(other, Mapping):
for key in other:
self[key] = other[key]
for key, value in other.items():
self[key] = value
elif hasattr(other, "keys"):
for key in other.keys():
self[key] = other[key]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved performance of ``MutableMapping.update``.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Improved performance of ``MutableMapping.update``.
Improved performance of :meth:`MutableMapping.update`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually tried this one first, but CI complained that it cannot find the RST-reference.

https://github.com/python/cpython/compare/b78241be0ce1147a9b79b50edf2b8ddb95852f37..d6f4c823eaaa30642984f3a30e02f26c00112f23

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah sorry about that. It probably should be something like :meth:`collections.abc.MutableMapping.update`.

Loading