Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ipython/ipython
/ cast_unicode
Function
cast_unicode
IPython/utils/py3compat.py:26–29 ·
view source on GitHub ↗
(s, encoding=None)
Source
from the content-addressed store, hash-verified
24
25
26
def
cast_unicode(s, encoding=None):
27
if
isinstance(s, bytes):
28
return
decode(s, encoding)
29
return
s
30
31
def
cast_bytes(s, encoding=None):
32
if
not isinstance(s, bytes):
Callers
3
find_file
Function · 0.90
data
Method · 0.90
latex_to_png
Function · 0.90
Calls
1
decode
Function · 0.85
Tested by
no test coverage detected