sandyharvie opened a new issue, #3467:
URL: https://github.com/apache/fory/issues/3467
### Feature Request
I would like to use `pyfory` as a drop-in replacement for `cloudpickle`, but
attempting to serialize an `object` instance results in an `AttributeError`.
```
>>> import pyfory
>>> fory = pyfory.Fory(xlang=False, ref=True, strict=False)
>>> o = object()
>>> fory.serialize(o)
Traceback (most recent call last):
File "<python-input-4>", line 1, in <module>
fory.serialize(o)
~~~~~~~~~~~~~~^^^
File "python/pyfory/serialization.pyx", line 1292, in
pyfory.serialization.Fory.serialize
File "python/pyfory/serialization.pyx", line 1330, in
pyfory.serialization.Fory._serialize
File "python/pyfory/serialization.pyx", line 1363, in
pyfory.serialization.Fory.write_ref
File "python/pyfory/serialization.pyx", line 1828, in
pyfory.serialization.Serializer.write
File
"/home/charvie/.venv/pyrex/lib/python3.13/site-packages/pyfory/serializer.py",
line 1309, in write
sorted_field_names = sorted(value.__dict__.keys())
^^^^^^^^^^^^^^
AttributeError: 'object' object has no attribute '__dict__'. Did you mean:
'__dir__'?
```
### 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]