Hello there !!
I would like to question a piece of code and how it's being used if possible:
Looking at this method and where the method escape_val is being used, why is the need of making the val.replace('\\', '\\\\')
?
If I'm thinking straight, since the JSON is passed to a Python Dict, the key values which are already a String, to Python it will be converted to a "normal" String as well. So I don't really understand the origin of the \\
, is this to cover some sort of special characters that on Python is not visible at when debugging or printing/logging ?
Other thing is that I noticed it that the considition isinstance(val, int)
isn't necessary since there is a step of mapping all elements_orders valus transforming them into string.
Best regards,
Rúben Garcia