djblets.util.typing¶
Common type definitions used for Djblets and consuming projects.
Changed in version 6.0: Updated many of the exports here to just be forwarding exports for typelets.
New in version 3.3.
- class ToJsonProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolProtocol for a class containing a to_json function.
This enables supporting classes that can serialize themselves via a
to_json()method inSerializableJSONValue.New in version 4.0.
- to_json() djblets.util.typing.SerializableJSONValue[source]¶
Return a JSON-serializable value for the object.
- Returns:
The JSON-serializable value.
- Return type:
SerializableJSONValue
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- __init__(*args, **kwargs)¶
- __parameters__ = ()¶
- __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).