PointPartialTypedDict
PointPartialTypedDict is a named dictionary type used in Python typing to describe a Point object where the coordinate fields may be omitted. It is commonly employed in type checking to model partial data, such as incremental construction, partial updates, or loosely specified API payloads.
In standard Python typing, a PointPartialTypedDict is typically defined as a TypedDict with optional keys. The
class PointPartialTypedDict(TypedDict, total=False):
With this definition, dictionaries like {} , {"x": 1.0}, {"y": 2.0}, or {"x": 1.0, "y": 2.0} are all
Since Python 3.11, the typing module supports NotRequired for more precise partial typing via PEP 655. This
from typing import TypedDict, NotRequired
class PointPartialTypedDict(TypedDict):
Use cases include functions that accept partial coordinates for updates or validation routines that tolerate missing
See also: TypedDict, NotRequired, PEP 655, typing_extensions.