MCPcopy Create free account
hub / github.com/mozilla/cipherscan / format_array

Function format_array

cscan/messages.py:58–69  ·  view source on GitHub ↗

Return string representation of array while formatting elements.

(array, formatstr)

Source from the content-addressed store, hash-verified

56
57
58def format_array(array, formatstr):
59 """Return string representation of array while formatting elements."""
60 if array is None:
61 return "None"
62 else:
63 str_array = []
64 for elem in array:
65 if elem.__class__.__format__ is not object.__format__:
66 str_array += ["{0:{1}}".format(elem, formatstr)]
67 else:
68 str_array += [repr(elem)]
69 return "[" + ", ".join(str_array) + "]"
70
71
72class ServerHello(messages.ServerHello):

Callers 1

__format__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected