logoalt Hacker News

aewensyesterday at 1:26 PM1 replyview on HN

You may be thinking of the `frozenset()` built in or the third party Python module [frozendict](https://pypi.org/project/frozendict/)?

Personally, I’ve been using a wrapper around `collections.namedtuple` as an underlying data structure to create frozen dictionaries when I’ve needed something like that for a project.


Replies

guidopallemansyesterday at 1:47 PM

When you are making str -> Any dictionaries it's quite likely you're better off with dataclasses or namedtuples anyway.

show 1 reply