Shared types¶
The cross-cutting typing primitives reused across lairs: the recursive
JsonValue alias for JSON-shaped data, and the type variables for
generic helpers. Polymorphism elsewhere is expressed through these
aliases, concrete unions, generics, and protocols rather than Any or
object.
lairs._types ¶
Shared type aliases and type variables for lairs.
This module defines the small set of cross-cutting typing primitives that the
rest of lairs reuses, most importantly the recursive JsonValue alias used
for JSON-shaped data such as lexicon documents and XRPC payloads. Nothing in
lairs ever annotates with Any or object; polymorphism is expressed
through these aliases, concrete unions, generics, and protocols.
T_co
module-attribute
¶
A covariant type variable for producer-shaped generics (for example exporters).
T_contra
module-attribute
¶
A contravariant type variable for consumer-shaped generics.
JsonValue ¶
A recursive alias for any JSON-serialisable value.
This is the single shared shape for JSON documents (lexicons) and XRPC request
and response payloads. It is used in place of Any wherever lairs handles
arbitrary-but-JSON-shaped data.