Settings

Theme

Tell HN: CodeSignal executes buggy, custom Python build

2 points by flerovium 3 years ago · 0 comments · 1 min read


TLDR: weird treatment of global/nonlocal in CodeSignal, probably because they're wrapping the function.

I nearly lost a job offer today because CodeSignal does not execute 'real' Python.

Minimal example:

x = {} def f(): global x x['key'] = 'value' f()

This will succeed in real python, but fail in CodeSignal. To make it work in CodeSignal, you need to change "global" to "nonlocal":

x = {} def f(): nonlocal x x['key'] = 'value' f()

This will fail in Python! This should definitely come with a disclaimer on their site. It's criminal that you can write correct python and they can incorrectly mark your code as nonfunctional.

Perhaps I shouldn't give a minimal example, but only tell CodeSignal that their Python build was failing on my hidden test case...

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection