Better HN
topnewbestaskshowjobs
Log inSign up

ljojiasdf

2 karma · joined Apr 21, 2022 (4y ago) · 1 submissions

Submissions

comment 4y ago · link · parent

Can you re-read please?

https://peps.python.org/pep-0544/#:~:text=Structural%20subty....

> substituted-for class to be defined as a protocol.

... which is false

> Similarly, the heading on the dictionary says “for a fixed set of keys” — but what if I want a dynamic heterodox dict? Eg, unpacking JSON.

You can quite obviously decode to recursive types (e.g. using pydantic), not sure what the problem is.