Given that in my python script i have a user defined class item
, with properties name: str
and valid: bool
, and a corresponding class in my C++ program, is there any way i can unpickle a pickle file, pickled in python, that contains an instance of my python item
class, in C++?
Asked
Active
Viewed 85 times
1

czyngis
- 413
- 2
- 5
- 18
-
Can you post example code of what you've tried. – ruohola Jun 14 '21 at 08:41
-
I don't know if what you are asking about is possible, but have you considered using a more language-neutral serialization like JSON or YAML (which are also fairly easy to use from Python)? – fakedad Jun 14 '21 at 08:50
-
@ruhola, @fakdedad I have indeed considered these solutions. The example is so simple there is no code needed, still though i was wondering if i could use the `pickle` module instead of serializing my class instances to dictionaries and then JSON. – czyngis Jun 14 '21 at 08:57