MCPcopy Index your code
hub / github.com/plotly/plotly.py / to_str_or_unicode_or_none

Method to_str_or_unicode_or_none

_plotly_utils/basevalidators.py:1016–1024  ·  view source on GitHub ↗

Convert a value to a string if it's not None, a string, or a unicode (on Python 2).

(v)

Source from the content-addressed store, hash-verified

1014
1015 @staticmethod
1016 def to_str_or_unicode_or_none(v):
1017 """
1018 Convert a value to a string if it's not None, a string,
1019 or a unicode (on Python 2).
1020 """
1021 if v is None or isinstance(v, str):
1022 return v
1023 else:
1024 return str(v)
1025
1026 def description(self):
1027 desc = """\

Callers 1

validate_coerceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected