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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: Inside Python Dict – an explorable explanation

111 点作者 eatitraw超过 6 年前

3 条评论

stinos超过 6 年前
<i>Python lists are actually arrays — contiguous chunks of memory.</i><p>Just wondering here, is this guaranteed to always be the case? Practically it probably is, but does the Python spec (as in: the laguage, not one of it&#x27;s implementations) say a list must be implemented using contiguous memory of slots with Python objects? That seems so low-level and C-ish. Or does the OP actually mean <i>CPython</i> here for instance?
评论 #18758531 未加载
评论 #18756723 未加载
评论 #18756722 未加载
评论 #18757399 未加载
评论 #18757019 未加载
评论 #18758255 未加载
whoisnnamdi超过 6 年前
Thanks. Slowing realizing some of the benefits of dicts and trying to use them more in my code where I would have otherwise defaulted to another data structure.<p>They really are quite useful and intuitive to work with once you understand basic structure<p>I do sometimes worry about speed relative to other options though, especially in large chunks of data
deepakg超过 6 年前
Related: <a href="https:&#x2F;&#x2F;pyvideo.org&#x2F;pycon-us-2017&#x2F;modern-python-dictionaries-a-confluence-of-a-dozen-great-ideas.html" rel="nofollow">https:&#x2F;&#x2F;pyvideo.org&#x2F;pycon-us-2017&#x2F;modern-python-dictionaries...</a>