Datatypes¶
Module containing internal classes used for storing internal data
Exposed classes offer a bit of introspection that can be useful
- 
class 
pheres._datatypes.JsonAttr(module: ModuleType, cls_name: str, name: str, py_name: str, type: TypeHint, default: Any = MISSING, is_json_only: Union[_MISSING, bool] = MISSING, *, cls: type = None)¶ Bases:
objectStores information for a json attribute
- Variables
 
- 
property 
is_required¶ Returns True if this attribute is mandatory in JSON
- 
get_default()¶ Returns the default value of this attribute
The returned value is a copy and is safe to use and modify
- 
class 
pheres._datatypes.ValueData(type: TypeHint)¶ Bases:
objectOpaque type storing pheres data for jsonable values
Exposed for used with
issubclass
- 
class 
pheres._datatypes.ArrayData(types: tuple)¶ Bases:
objectOpaque type storing pheres data for jsonable arrays
Exposed for used with
issubclass
- 
class 
pheres._datatypes.DictData(type: TypeHint)¶ Bases:
objectOpaque type storing pheres data for jsonable dicts
Exposed for used with
issubclass
- 
class 
pheres._datatypes.ObjectData(attrs: dict[str, JsonAttr])¶ Bases:
objectOpaque type storing pheres data for jsonable objects
Exposed for used with
issubclass
- 
class 
pheres._datatypes.DelayedData(func: Callable[[type], type], kind: JsonableEnum)¶ Bases:
objectOpaque type storing pheres data for jsonable that have been delayed
Exposed for used with
issubclass- Variables
 kind (pheres._datatypes.JsonableEnum) – What type of jsonable the class will be once decorated (This has not happened yet !)
- 
class 
pheres._datatypes.UsableDecoder(*, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)¶ Bases:
json.decoder.JSONDecoderjson.JSONDecodersubclass with wrapper methodsload()andloads()using itself for the decoder class- 
classmethod 
load(*args, **kwargs)¶ Thin wrapper around
json.loadthat use this class as the defaultclsargument
- 
classmethod 
loads(*args, **kwargs)¶ Thin wrapper around
json.loadsthat use this class as the defaultclsargument
- 
classmethod