
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
An immutable dictionary class for Python, implemented as a thin layer around Python's builtin dict
class. It is often faster than other immutable dictionary implementations.
Install this package with:
$ pip install constantdict
Usage example:
from constantdict import constantdict
cd = constantdict({1: 2})
# constantdicts compare equal to dicts with the same items
assert cd == {1: 2}
# constantdicts are hashable, and their hashes are cached
print(hash(cd), cd)
# Attempting to modify a constantdict in-place raises an AttributeError
try:
# Similar for pop(), popitem(), clear(), and del
cd[4] = 12
except AttributeError:
pass
# Some methods return a mutated copy of a constantdict
cd_new = cd.setdefault(10, 5)
assert cd_new == {1: 2, 10: 5}
# Similar for set(), update(), delete(), discard()
# Performing multiple mutations can be faster via mutate()/finish()
cd_mut = cd.mutate() # cd_mut is a mutable copy of cd
cd_mut[42] = 0
del cd_mut[1]
cd_new2 = cd_mut.finish() # cd_new2 is an immutable version of cd_mut
assert cd_new2 == {42: 0}
Please also see the documentation,
as well as the examples in the examples/
directory.
MIT License.
FAQs
An immutable dict class.
We found that constantdict demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.