MCPcopy Create free account
hub / github.com/python-hyper/uritemplate / quote

Method quote

uritemplate/variable.py:157–165  ·  view source on GitHub ↗
(self, value: t.Any)

Source from the content-addressed store, hash-verified

155 return value
156
157 def quote(self, value: t.Any) -> str:
158 if not isinstance(value, (str, bytes)):
159 value = str(value)
160 if isinstance(value, bytes):
161 value = value.decode()
162
163 if self == Operator.reserved or self == Operator.fragment:
164 return self._only_quote_unquoted_characters(value)
165 return self._always_quote(value)
166
167 @staticmethod
168 def from_string(s: str) -> "Operator":

Callers 4

_label_path_expansionMethod · 0.80
_semi_path_expansionMethod · 0.80
_string_expansionMethod · 0.80
quoteFunction · 0.80

Calls 2

_always_quoteMethod · 0.95

Tested by

no test coverage detected