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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Tell HN: CodeSignal executes buggy, custom Python build

2 点作者 flerovium将近 2 年前
TLDR: weird treatment of global&#x2F;nonlocal in CodeSignal, probably because they&#x27;re wrapping the function.<p>I nearly lost a job offer today because CodeSignal does not execute &#x27;real&#x27; Python.<p>Minimal example:<p>x = {} def f(): global x x[&#x27;key&#x27;] = &#x27;value&#x27; f()<p>This will <i>succeed</i> in real python, but fail in CodeSignal. To make it work in CodeSignal, you need to change &quot;global&quot; to &quot;nonlocal&quot;:<p>x = {} def f(): nonlocal x x[&#x27;key&#x27;] = &#x27;value&#x27; f()<p>This will fail in Python! This should definitely come with a disclaimer on their site. It&#x27;s criminal that you can write <i>correct</i> python and they can incorrectly mark your code as nonfunctional.<p>Perhaps I shouldn&#x27;t give a minimal example, but only tell CodeSignal that their Python build was failing on my hidden test case...

暂无评论

暂无评论