pg.typing.ConstStrKey¶
Accessible via pg.typing.ConstStrKey
.
- class ConstStrKey(text)[source]¶
Bases:
KeySpecBase
,pg.object_utils.StrKey
Class that represents a constant string key.
Example:
key = pg.typing.ConstStrKey('x') assert key == 'x' assert hash(key) == hash('x')
Methods:
format
(**kwargs)Format this object.
match
(key)Whether can match against an input key.
to_json
(**kwargs)Returns a plain Python value as a representation for this object.
Attributes:
- 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.