We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75a5e9d commit 525da68Copy full SHA for 525da68
docs/spec/typeddict.rst
@@ -353,15 +353,15 @@ Discussion:
353
x: int
354
y: str
355
356
- def f(a: A) -> None:
357
- a['y'] = 1
+ def f(a: A) -> None:
+ a['y'] = 1
358
359
- def g(b: B) -> None:
360
- 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'
361
362
- c: C = {'x': 0, 'y': 'foo'}
363
- g(c)
364
- c['y'] + 'bar' # Runtime error: int + str
+ c: C = {'x': 0, 'y': 'foo'}
+ g(c)
+ c['y'] + 'bar' # Runtime error: int + str
365
366
* A TypedDict isn't :term:`assignable` to any ``Dict[...]`` type, since
367
dictionary types allow destructive operations, including ``clear()``. They
0 commit comments