MCPcopy Create free account
hub / github.com/StackStorm/st2 / get_cast

Function get_cast

st2common/st2common/util/casts.py:102–112  ·  view source on GitHub ↗

Determines the callable which will perform the cast given a string representation of the type. :param cast_type: Type of the cast to perform. :type cast_type: ``str`` :rtype: ``callable``

(cast_type)

Source from the content-addressed store, hash-verified

100
101
102def get_cast(cast_type):
103 """
104 Determines the callable which will perform the cast given a string representation
105 of the type.
106
107 :param cast_type: Type of the cast to perform.
108 :type cast_type: ``str``
109
110 :rtype: ``callable``
111 """
112 return CASTS.get(cast_type, None)

Callers 4

test_cast_stringMethod · 0.90
test_cast_arrayMethod · 0.90
cast_paramsFunction · 0.90
_castFunction · 0.90

Calls 1

getMethod · 0.45

Tested by 2

test_cast_stringMethod · 0.72
test_cast_arrayMethod · 0.72