Your question is Deep Equality for Nested Data. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Patreon configuration data can contain nested objects and arrays, such as creator page settings or membership benefit definitions. Implement is_equal(a, b) to determine whether two JSON-like values are structurally and recursively equal.
The inputs a and b are JSON-like Python values composed only of None, booleans, integers, floats, strings, lists, and dictionaries with string keys. Return True only when:
You may assume the structures are acyclic. Do not convert the values to strings or sort serialized output. Implement the comparison directly.
def is_equal(a, b):