MCPcopy Create free account
hub / github.com/ActiveState/code / text

Function text

recipes/Python/576445_ElementTree_Wrapper/recipe-576445.py:23–28  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

21 return ' '.join('%s = "%s"' % (key,value) for key,value in obj.items())
22
23def text(obj):
24 if type(obj) in (int,float):
25 return str(obj)
26 elif is_text(obj):
27 return obj
28 return str(obj)
29
30PREFIX_PAT = re.compile('(\{.*\})')
31

Callers 1

__new__Method · 0.70

Calls 2

strFunction · 0.85
is_textFunction · 0.85

Tested by

no test coverage detected