Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
sevensor
6mo ago
0 comments
Save
Share
No, I’d type the function argument as a Mapping. Frozendict is so that the function will raise an exception if it violates its type signature.
Edit: that is, if as the caller you want foo to be immutable, then you make it a frozendict
0 comments
1 comments · 1 top-level
top
newest
oldest
quietbritishjim
6mo ago
Ah, I see. The last sentence in your previous comment makes more sense now ("Mapping is great, but ... you can violate it at run time"). A type checker would normally catch violations but I can still see a frozendict would be useful.
j
/
k
navigate · click thread line to collapse