APrioriInvestments / typed_python

An llvm-based framework for generating and calling into high-performance native code from Python.
Apache License 2.0
198 stars 8 forks source link

SerializationContext cannot serialize numpy ufuncs #417

Closed wllgrnt closed 1 year ago

wllgrnt commented 1 year ago

Repro:

import numpy
from typed_python import SerializationContext

res = SerializationContext().serialize(numpy.sin)
print(res)

Expected behaviour

res should be a bytes object. Note that pickle.dumps(numpy.sin) does return a bytes object, as expected.

Actual behaviour.

We get TypeError: cannot pickle 'numpy.ufunc' object.