←back to thread

191 points jwilk | 1 comments | | HN request time: 0.201s | source
Show context
codethief ◴[] No.46230017[source]
Next step: Auto-inferring the correct (most narrow) TypedDict type from a frozendict. (Think `const foo = { … } as const` in TypeScript.) I miss this TS feature in Python on the daily.
replies(5): >>46230085 #>>46230120 #>>46230296 #>>46230354 #>>46230695 #
1. anentropic ◴[] No.46230695[source]
Agreed... but it shouldn't need a frozendict for this

IMHO TypedDict in Python are essentially broken/useless as is

What is needed is TS style structural matching, like a Protocol for dicts