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.PrimitiveType
Base class for value spec of numeric types.
Methods:
format
(*[, markdown])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.
- 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
,tuple
where the container types should have plain Python values as their values.