MCPcopy Index your code
hub / github.com/RustPython/RustPython / encode

Function encode

Lib/os.py:786–789  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

784 # Where Env Var Names Can Be Mixed Case
785 encoding = sys.getfilesystemencoding()
786 def encode(value):
787 if not isinstance(value, str):
788 raise TypeError("str expected, not %s" % type(value).__name__)
789 return value.encode(encoding, 'surrogateescape')
790 def decode(value):
791 return value.decode(encoding, 'surrogateescape')
792 encodekey = encode

Callers 1

encodekeyFunction · 0.70

Calls 2

isinstanceFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected