typed_python icon indicating copy to clipboard operation
typed_python copied to clipboard

Can't serialize some kinds of bound methods

Open braxtonmckee opened this issue 5 years ago • 3 comments

Our methodology for serializing core python objects works for lots of things, but not certain kinds of types and methods. For instance

import numpy
import typed_python.Codebase as Codebase
sc = Codebase.Codebase.coreSerializationContext()

sc.serialize(numpy.array) # throws
sc.serialize(numpy.array([1,2,3])) # OK
sc.serialize(numpy.array([1,2,3]).max) # throws
sc.serialize(numpy.max) # throws

throw errors where named. We should be able to serialize any of these.

braxtonmckee avatar Jun 23 '19 19:06 braxtonmckee

We can now serialize 'numpy.array', but not the method. Nor can we serialize bound methods of regular classes.

braxtonmckee avatar Oct 19 '20 02:10 braxtonmckee

We should really just support the reduce protocol for objects like these

braxtonmckee avatar Oct 19 '20 02:10 braxtonmckee

c.f #417

wllgrnt avatar Feb 16 '23 16:02 wllgrnt