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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Hashing it Out

49 点作者 barbierocks将近 5 年前

2 条评论

barbierocks将近 5 年前
Here&#x27;s a cute follow-up: what are all possible outputs of the following program?<p><pre><code> import random class C: def __hash__(self): # return 0 or 1, with equal probability return random.randint(0, 1) x = C() d = {} d[x] = &quot;foo&quot; d[x] = &quot;bar&quot; d[x] = &quot;baz&quot; print(len(d), d[x])</code></pre>
评论 #23794405 未加载
DabbyDabberson将近 5 年前
The real treasure of akshayr.me:<p><a href="https:&#x2F;&#x2F;akshayr.me&#x2F;snoop&#x2F;" rel="nofollow">https:&#x2F;&#x2F;akshayr.me&#x2F;snoop&#x2F;</a>
评论 #23798097 未加载