escape checked if o.__class__ is str to skip a cast/copy str(o). However, proxy types that forward attribute access on to the proxied value would report o.__class__ as str, even though they were still the proxy class. This caused the C speedups to fail since they expected to be working with str data at that point. Use type(o) is str instead, which can't be affected by proxies.
escape
checked ifo.__class__ is str
to skip a cast/copystr(o)
. However, proxy types that forward attribute access on to the proxied value would reporto.__class__
asstr
, even though they were still the proxy class. This caused the C speedups to fail since they expected to be working with str data at that point. Usetype(o) is str
instead, which can't be affected by proxies.fixes #467