Skip to content
Prev Previous commit
Capitalise Point2D
  • Loading branch information
AlexWaygood committed Jun 5, 2023
commit 58fbb0f5cb68e5044b6ac891a8b910ce7817ae36
6 changes: 3 additions & 3 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2874,19 +2874,19 @@ class Point2D(TypedDict):
By default, all keys must be present in a TypedDict. It is possible
to override this by specifying totality::

class point2D(TypedDict, total=False):
class Point2D(TypedDict, total=False):
x: int
y: int

This means that a point2D TypedDict can have any of the keys omitted. A type
This means that a Point2D TypedDict can have any of the keys omitted. A type
checker is only expected to support a literal False or True as the value of
the total argument. True is the default, and makes all items defined in the
class body be required.

The Required and NotRequired special forms can also be used to mark
individual keys as being required or not required::

class point2D(TypedDict):
class Point2D(TypedDict):
x: int # the "x" key must always be present (Required is the default)
y: NotRequired[int] # the "y" key can be omitted

Expand Down