Assign types to a Dict returned by PyCall

For reference,

PyDict{String, Int}(py"{'foo': 123, 'bar': 456}"o)

make no copies at all — it’s just a thin wrapper around the underlying Python dictionary. (Note the py"..."o, where the o suppresses automatic conversion and instead gives a raw Python object.)

3 Likes