To reinforce what others have said a bit:

It is absolutely OK to expect people to write code with a code editor. Period. And having more than the alread two quote characters would be a mess.

But this IS an issue, not with people writing code with tools meant for writing text, but by people copying and pasting code examples from systems that have mangled the text in these ways. I've encountered this a fair bit, notably when I wrote a whole bunch of instructional slides for a Python course in LaTeX, and it replaced quotes with nifty curly quotes -- I think even in verbatim mode. So when I, or my students, copy and pasted code, it was broken.

So yes to Ned's suggestion:

More informative syntax Error messages.

Note that it IS a bit of a trick with this kind of thing: there could be who knows how many characters that *could* look kinda like meaningful symbols in Python. But catching the most common ones would help folks out.

It would be good for linters to catch these too -- but that's up to the linter authors


Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython