From e7c158a9e085722b9b434de463d2d9eef47b0634 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 10 Apr 2025 03:08:27 +0500 Subject: [PATCH] Docs - fix indentation issue in TypedDict article --- docs/spec/typeddict.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 15d9aeaad..559771f77 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -353,15 +353,15 @@ Discussion: x: int y: str - def f(a: A) -> None: - a['y'] = 1 + def f(a: A) -> None: + a['y'] = 1 - def g(b: B) -> None: - f(b) # Type check error: 'B' not assignable to 'A' + def g(b: B) -> None: + f(b) # Type check error: 'B' not assignable to 'A' - c: C = {'x': 0, 'y': 'foo'} - g(c) - c['y'] + 'bar' # Runtime error: int + str + c: C = {'x': 0, 'y': 'foo'} + g(c) + c['y'] + 'bar' # Runtime error: int + str * A TypedDict isn't :term:`assignable` to any ``Dict[...]`` type, since dictionary types allow destructive operations, including ``clear()``. They