plain#
- scikitplot.agent.plain(value, *, what='value')[source]#
Return
valueas a plain JSON value, or raise.- Parameters:
- valueobject
None,bool,int,float,str, or alist,tuple, ordictof them (dictkeys must bestr).- whatstr, default=”value”
Names the value in an error message.
- Returns:
- object
A new value of plain JSON types: tuples become lists,
dictsubclasses becomedict. Scalars are returned as they are.
- Raises:
- TypeError
If the value, or anything inside it, is of another type, or a key is not a string.
- ValueError
If a float is not finite, a string holds a lone surrogate, an integer has more than
MAX_INT_DIGITSdigits, or the nesting is deeper thanMAX_DEPTH.
- Parameters:
- Return type:
Examples
>>> from scikitplot.agent._canonical import plain >>> plain({"a": (1, 2.5, None)}) {'a': [1, 2.5, None]}