From 3115cb1435f1c1ccafbef525e1489af9bd171c61 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 23 Dec 2024 23:35:48 +0000 Subject: [PATCH] Document that dict.get takes no keyword arguments Running ```python {}.get("a", default="b") ``` gives: ``` {}.get("a", default="b") ~~~~~~^^^^^^^^^^^^^^^^^^ TypeError: dict.get() takes no keyword arguments ``` --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 191827526e890f..9d40a2d45f7ece 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -4640,7 +4640,7 @@ can be used interchangeably to index the same dictionary entry. such as an empty list. To get distinct values, use a :ref:`dict comprehension ` instead. - .. method:: get(key, default=None) + .. method:: get(key, default=None, /) Return the value for *key* if *key* is in the dictionary, else *default*. If *default* is not given, it defaults to ``None``, so that this method pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy