Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dill can't serialize classmethod packaged with cython #564

Open
luckqk opened this issue Nov 14, 2022 · 0 comments
Open

dill can't serialize classmethod packaged with cython #564

luckqk opened this issue Nov 14, 2022 · 0 comments

Comments

@luckqk
Copy link

luckqk commented Nov 14, 2022

I create a class like

class Fly:   
    @classmethod
    def say(cls):
         print("hello world")

it's saved in tool.py file and placed under tt directory
package it with cython and will get .so file

The test code is here

from tt.tool import Fly
from pathos.pools import  _ProcessPool as Pool
def f(c):
    c()

pool = Pool(1)
t = pool.apply_async(func=f, args=(Fly.say,))
t.get()

this will generate exception
can't pickle <cyfunction xxxx>: it's not the same object as xxx

I have tried pickle and it can deal with this scenario, can it be solved in dill?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant