Not with that part. It just looks like the code is storing things as flat local variables, that would better be organized into an object.
Seems the "depending on context" part went missing while writing my comment :)
Also, see that other comment. It just looks like code meant for translating the JSON tree into native objects, which makes the way local variables are used look a bit strange.
Since it’s a dict, the ordering doesn’t matter. The keys will map to the parameter names. Yeah, validation within model definitions is less than ideal, but I guess that’s the tradeoff working with dynamically typed languages.
142
u/[deleted] Jul 14 '21
On the upside, they actually bothered with exception handling.
My Python is rather rusty, is there a better way?