Non-native apologizes, writes perfect Python; native replies with buggy comprehension
Description
Black-and-white stick-figure comic: two figures sit at a bar, each holding a mug. Above the left figure a speech bubble reads “- Sorry for my bad English, it’s not my mother tongue” and shows three tidy Python comprehensions: “foos = (i for i in xrange(10))”, “bars = {j for j in foos}”, “bazs = {k for k in bars}”. The word “non-native” is written under this character. The right figure’s tilted speech bubble says “- LOL ITS OKEY” followed by the malformed code “{k for x in xs for xs in ys for ys in lst}”; the label “native” appears underneath. Visually simple lines highlight the contrast: the apologetic non-native speaker uses syntactically correct, idiomatic Python while the native speaker’s English spelling and set-comprehension order are both wrong, poking fun at assumptions about language proficiency and code quality
Comments
16Comment deleted
I’ll take “sorry for my bad English” and an O(n) generator any day over “LOL ITS OKEY” and a comprehension that’s both O(n³) and a NameError factory
The real bug in production isn't the non-native speaker's English - it's the native speaker who approved that nested generator expression without a code review comment about readability
The real plot twist: the 'non-native' developer writes production-ready Python with proper generator expressions and set comprehensions, while the 'native' speaker delivers a nested comprehension crime scene that would make any code reviewer reach for the reject button. Turns out fluency in English doesn't correlate with fluency in Pythonic idioms - though both will confidently ship to prod on a Friday
The ESL dev writes three clean generators; the native replies with a triple‑nested, shadowing comprehension - proof that PEP 20 is advisory and code reviews are NP‑hard
'foos := for in foos[]': the one syntax every senior dev reads fluently, no matter the passport
Code review takeaway: the non‑native’s English was fine; the native’s Python wasn’t - {x for x in xs for xs in ys for ys in lst} violates more of the Zen of Python than “OKEY” violates grammar
once upon a time in a gay bar Comment deleted
Being gay is a bit gay you know Comment deleted
Ugly mfs Comment deleted
the left one can be substituted with just "xrange(10)" and it'll have the same effect, tho why would you use python 2 in 2021... the right one is just plain incorrect, inner loops go on the right hand side. should be (x for ys in lst for xs in ys for x in xs) Comment deleted
shouldn't it be ordered the other way round? Comment deleted
(in native) Comment deleted
nesting inline fors has to be done in reverse Comment deleted
nesting inline fors should be illegal too Comment deleted
aye Comment deleted
If inline fors were the way they are in the pic, they would be intuitive and useful Comment deleted