TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Python proposal: add immutable (persistent) dictionaries

17 点作者 dikbrouwer超过 5 年前

3 条评论

snrji超过 5 年前
This is the kind of ad-hoc PEP proposal that could be completely avoidable if there was a generic modifier or initialization/declaration construction for declaring a variable as constant. So incredibly simple, so incredibly useful that it's hard to believe that it hasn't been accepted yet (it was proposed).
评论 #21020657 未加载
yen223超过 5 年前
Something interesting to note is that Python’s ContextVar (introduced in Python 3.7) is a persistent dictionary.<p><a href="https:&#x2F;&#x2F;www.python.org&#x2F;dev&#x2F;peps&#x2F;pep-0567&#x2F;#implementation" rel="nofollow">https:&#x2F;&#x2F;www.python.org&#x2F;dev&#x2F;peps&#x2F;pep-0567&#x2F;#implementation</a>
lolc超过 5 年前
Nice I like having persistent structures available. Then I don&#x27;t have to safeguared against unintended modifications.