I have my custom class that represents an object. I want to make that object compatible with "ast.literal_eval()"
How can I do that? I can add necessary method/code to my class if necessary.
I have my custom class that represents an object. I want to make that object compatible with "ast.literal_eval()"
How can I do that? I can add necessary method/code to my class if necessary.
You cannot. You will need to reimplement it from scratch, adding support for your class within it.
Because you tagged your question with Pyro, I assume you're asking it in the context of serializing your own classes when using Pyro's remote method calls. Pyro provides a mechanism to do that.