3 ms·
A fun issue I keep hitting with Github Copilot in Python is that it's a coin flip whether it will give me a Python 3-style print statement or a Python 2.7 style
by minimaxir 5y ago
A fun issue I keep hitting with Github Copilot in Python is that it's a coin flip whether it will give me a Python 3-style print statement or a Python 2.7 style print statement.
- hrithwikbha 5y agoSame lol . Most of the times I get Python 2 print statements
- mdaniel 5y agoGiven that no one should be _actively_ writing 2.7 code, and that GH is trying to monetize this, I would think they could retrain the main model that excludes 2.7 code, and then allow people who need 2.7 to "pay for supporting 2.7" just like I'm guessing folks stuck on old platforms always do You raise a fascinating point about older platforms of other languages, too; Java has a super backward compat story, but woe be unto the coder who tries to name a variable "enum" nowadays
- kzrdude 5y agoThis seems to be another side of the problem that it gives code that doesn't actually compile for the target language. They should have a check for that, that should be the baseline. For me, it sounds like it's closer to dumb copy paste than a smart code generator. AlphaZero wouldn't play a chess move that was against the rules.
- jononor 5y agoMost instances of that should be fixable with some post-processing in Copilot. They could maybe even run py2to3 on it?
- mkl 5y agoI think preprocessing, upgrade the input data before training.
- addandsubtract 5y agoThen you have to trust that not only the original code works, but also the preprocessed upgrade. What could go wrong...
- tormeh 5y agoCould Copilot integrate linters? I.e. it doesn't suggest code that doesn't pass lint? That'd get rid of this, at least. I love linters so much...