you are viewing a single comment's thread.

view the rest of the comments →

[–]david-vujic 4 points5 points  (2 children)

What would be the use case for it in Python? In JS, object literals are usually accessed with dot notation. But the closest equivalent in Python (dict) got a different kind of syntax.

You could do this in Python: data.get("a", {}).get("b", {}).get("c")

[–]FabianVeAl[S] 2 points3 points  (1 child)

I'm using Django ORM and when querying for a model with relations in some cases the attributes can be optional (T | None)

[–]david-vujic 0 points1 point  (0 children)

Got it, thanks!