Type

class audobject.resolver.Type[source]

Type resolver.

Encodes type as a string.

Examples

>>> resolver = Type()
>>> value = str
>>> value
<class 'str'>
>>> encoded_value = resolver.encode(value)
>>> encoded_value
'str'
>>> decoded_value = resolver.decode(encoded_value)
>>> decoded_value
<class 'str'>

__hash__()

Type.__hash__()

Return hash(self).

decode()

Type.decode(value)[source]

Decodes str as type.

Parameters

value (str) – type string

Return type

type

Returns

type

encode()

Type.encode(value)[source]

Encodes type as str.

Parameters

value (type) – type class

Return type

str

Returns

string

encode_type()

Type.encode_type()[source]

Return encoded type.

Return type

type

Returns

encoded type

root

Type.root

Root folder.

Returns root folder when object is serialized to or from a file, otherwise None is returned.

Returns

root directory