loadstr#

loadstr(string, **kwargs)[source]#

Like sc.load(), but for a bytes-like string (rarely used).

Parameters:
  • string (str) – the bytes-like string to load

  • kwargs (dict) – passed to sc.load()

Example:

obj = sc.objdict(a=1, b=2)
bytestring = sc.dumpstr(obj)
obj2 = sc.loadstr(bytestring)
assert obj == obj2
New in version 3.0.0: uses sc.load() for more robustness