pg.typing.Number¶
Accessible via pg.typing.Number.
- class Number(value_type, default=MISSING_VALUE, min_value=None, max_value=None, is_noneable=False, frozen=False)[source]¶
Bases:
pg.typing.Generic,pg.typing.PrimitiveTypeBase class for value spec of numeric types.
Methods:
format([compact, verbose, root_indent])Format this object.
to_json(**kwargs)Returns a plain Python value as a representation for this object.
Attributes:
Returns maximum value of acceptable values.
Returns minimum value of acceptable values.
- format(compact=False, verbose=True, root_indent=0, **kwargs)[source]¶
Format this object.
- Return type:
- to_json(**kwargs)[source]¶
Returns a plain Python value as a representation for this object.
A plain Python value are basic python types that can be serialized into JSON, e.g:
bool,int,float,str,dict(with string keys),list,tuplewhere the container types should have plain Python values as their values.