You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by "chaokunyang (via GitHub)" <gi...@apache.org> on 2025/07/10 07:02:57 UTC

[I] [Python] support serialize local class like cloudpickle [fory]

chaokunyang opened a new issue, #2402:
URL: https://github.com/apache/fory/issues/2402

   ### Feature Request
   
   Fory and Pickle doesn't support serialize local class object, for example:
   
   ```python
   def f():
       from dataclasses import dataclass
   
       @dataclass
       class LocalClass:
           a: int
           b: str
   
       local_class_instance = LocalClass(a=1, b="2")
       return local_class_instance
   
   
   import pickle
   
   pickle.dumps(f())
   ```
   
   will get error:
   ```python
   AttributeError                            Traceback (most recent call last)
   Cell In[6], line 15
        10     return local_class_instance
        13 import pickle
   ---> 15 pickle.dumps(f())
   
   AttributeError: Can't pickle local object 'f.<locals>.LocalClass'
   ```
   
   Fory can't serialize such objects too.
   
   ### Is your feature request related to a problem? Please describe
   
   _No response_
   
   ### Describe the solution you'd like
   
   _No response_
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [I] [Python] support serialize local function like cloudpickle [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on issue #2402:
URL: https://github.com/apache/fory/issues/2402#issuecomment-3055987017

   @esafak 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [I] [Python] support serialize local function [fory]

Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang closed issue #2402: [Python] support serialize local function
URL: https://github.com/apache/fory/issues/2402


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org


Re: [I] [Python] support serialize local function [fory]

Posted by "esafak (via GitHub)" <gi...@apache.org>.
esafak commented on issue #2402:
URL: https://github.com/apache/fory/issues/2402#issuecomment-3067127770

   Done, I think


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org