Skip to content

Commit c4079cb

Browse files
pythongh-117956: Document that MappingProxyType lookups propagate the mapping's errors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent dcf9087 commit c4079cb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎Doc/library/types.rst‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,9 @@ Standard names are defined for the following types:
408408

409409
.. describe:: proxy[key]
410410

411-
Return the item of the underlying mapping with key *key*. Raises a
412-
:exc:`KeyError` if *key* is not in the underlying mapping.
411+
Return ``mapping[key]``, the item of the underlying mapping with key
412+
*key*. Any exception raised by the underlying mapping is propagated,
413+
for example a :exc:`KeyError` if *key* is not in a :class:`dict`.
413414

414415
.. describe:: iter(proxy)
415416

0 commit comments

Comments
 (0)