Skip to content

Commit 904fc77

Browse files
[docs] Change the InlineTypedDict example (#20172)
This way it will be clear that there is no necessary connection between the name of the field and its type.
1 parent 62770f4 commit 904fc77

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/source/command_line.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,8 +1211,8 @@ List of currently incomplete/experimental features:
12111211

12121212
.. code-block:: python
12131213
1214-
def test_values() -> {"int": int, "str": str}:
1215-
return {"int": 42, "str": "test"}
1214+
def test_values() -> {"width": int, "description": str}:
1215+
return {"width": 42, "description": "test"}
12161216
12171217
12181218
Miscellaneous

docs/source/typed_dict.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ to use inline TypedDict syntax. For example:
303303

304304
.. code-block:: python
305305
306-
def test_values() -> {"int": int, "str": str}:
307-
return {"int": 42, "str": "test"}
306+
def test_values() -> {"width": int, "description": str}:
307+
return {"width": 42, "description": "test"}
308308
309309
class Response(TypedDict):
310310
status: int

0 commit comments

Comments
 (0)