How does python dictionary matching work?

Does it go as many levels as the nesting is in the dictionary?

I am to confirm that matching happens on all the levels with value equality.

I am looking for the actual equality implementation source as well.

8 comments · 100% upvoted · other discussions

comments

K900_

What do you mean by "matching", exactly?

codeforces_help [OP]

By matching I mean given two json values, with lets say 5 level of nesting for some key, how does matching work. Does it really go accessing each and every level to match the values at that level?

K900_

Can you post a code example?

codeforces_help [OP]

Consider the following json :

{
    "a": {
        "b": [1, 2, 3, {
            "c": {
                "d": (99, "if", "hello", {
                    "f": "98"
                })
            }
        }]
    }
}

Given another similar json or even this same json on the right side of equality operator, how would that work? Does it really go level by level, every path matching keys and values?

K900_

Yes, it does.

codeforces_help [OP]

Thanks.

Essence1337

What is 'dictionary matching' supposed to mean? Do you mean comparing dictionaries? Finding a value in a dictionary? Something else?

As for the source Python is open source on Github

codeforces_help [OP]

By matching I mean given two json values, with lets say 5 level of nesting for some key, how does matching work. Does it really go accessing each and every level to match the values at that level?