OrderedDicts and tuples in custom functions #94
-
Good morning! I don't know if I'm abusing the intended purpose of this project, but I created a function that recursively looks for a given key inside a JSON. The original code follows:
I tested it as a standalone function, and it worked like a charm. However, I tested it as an embedded function in the context, and it didn't work. After some peeks and pokes, I discovered the JSON was transformed, it changed the dicts into OrderedDicts and lists into tuples. After some changes, the following code worked:
My question is, why exactly did it happen? Thank you for the clarification! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Because I chose tuples and OrderdDict as the classes for normalizing the values that are being processed. There's a coerce value function that will perform this normalization. |
Beta Was this translation helpful? Give feedback.
Because I chose tuples and OrderdDict as the classes for normalizing the values that are being processed. There's a coerce value function that will perform this normalization.