0

I have a dictionary to store N number of partial function calls.

dict_ = {1: partial(FUNCTION, ARG1,ARG2,ARG3 )}

which works fine.

If I store this dictionary inside a .json file I have quotes around my partial call

dict_ =    {"1":"partial(FUNCTION, ARG1,ARG2,ARG3 )"}

How do I get rid of this quotes in order to execute the code?

ast.literal_eval(dict_ ['1'])

returns ValueError('malformed node or string:..

user2963882
  • 625
  • 1
  • 8
  • 19
  • 1
    You might be better off using a different serialization format, since json isn't really designed to store anything other than numbers/strings/dicts/lists. How do you feel about `pickle`? – Kevin Feb 04 '19 at 18:39
  • This might help: https://stackoverflow.com/a/18178379/ https://stackoverflow.com/a/14611535/ – Will Feb 05 '19 at 06:29

0 Answers0