>> A frozendict can be used as a member of a set or as a key in a dictionary. >> >> For example, frozendict is indirectly needed when you want to use an >> object as a key of a dict, whereas one attribute of this object is a >> dict. > > It isn't. You just have to define __hash__ correctly. Define __hash__ on a mutable object can be surprising. Or do you mean that you deny somehow the modification of the dict attribute, and convert the dict to a immutable object before hashing it? >> frozendict helps also in threading and multiprocessing. > > How so? For example, you don't need a lock to read the frozendict content, because you cannot modify the content. Victor
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4