<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Jul 19, 2016 at 8:18 AM Rustom Mody <<a href="mailto:rustompmody@gmail.com" target="_blank">rustompmody@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br>On Tuesday, July 19, 2016 at 5:06:17 PM UTC+5:30, Neil Girdhar wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"></div></div></blockquote></div><div dir="ltr"><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Jul 19, 2016 at 7:21 AM Steven D'Aprano wrote:<br></div></div></div></blockquote></div><div dir="ltr"><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Jul 18, 2016 at 10:29:34PM -0700, Rustom Mody wrote:<br>
<br></blockquote></div></div></blockquote></div><div dir="ltr"><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> IOW<br>
> 1. The lexer is internally (evidently from the error message) so<br>
> ASCII-oriented that any “unicode-junk” just defaults out to identifiers<br>
> (presumably comments are dealt with earlier) and then if that lexing action<br>
> fails it mistakenly pinpoints a wrong *identifier* rather than just an<br>
> impermissible character like python 2<br>
<br>
You seem to be jumping to a rather large conclusion here. Even if you<br>
are right that the lexer considers all otherwise-unexpected characters<br>
to be part of an identifier, why is that a problem?<br></blockquote></div></div></blockquote></div><div dir="ltr"><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>It's a problem because those characters could never be part of an identifier.  So it seems like a bug.</div></div></div></blockquote></div><div dir="ltr"><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"></div></div></blockquote><div><br>An armchair-design solution would say: We should give the most appropriate answer for every possible unicode character category<br>This would need to take all the Unicode character-categories and Python lexical-categories and 'cross-product' them — a humongous task to little advantage<br></div></div></blockquote><div><br></div></div><div dir="ltr"><div class="gmail_quote"><div>I don't see why this is a "humongous task".  Anyway, your solution boils down to the simplest fix in the lexer which is to block some characters from matching any category, does it not?</div></div></div><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br>A more practical solution would be to take the best of the python2 and python3 current approaches:<br>"Invalid character XX  in line YY"<br>and just reveal nothing about what lexical category — like identifier — python thinks the  char is coming in.<br><br>The XX is like python2 and the YY like python3<br>If it can do better than '\xe2' — ie a codepoint — that’s a bonus but not strictly necessary<br><br></div></div>

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to a topic in the Google Groups "python-ideas" group.<br>
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/python-ideas/-gsjDSht8VU/unsubscribe" target="_blank">https://groups.google.com/d/topic/python-ideas/-gsjDSht8VU/unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a href="mailto:python-ideas+unsubscribe@googlegroups.com" target="_blank">python-ideas+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/optout</a>.<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
<br>
--<br>
<br>
---<br>
You received this message because you are subscribed to a topic in the Google Groups "python-ideas" group.<br>
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/python-ideas/-gsjDSht8VU/unsubscribe" rel="noreferrer" target="_blank">https://groups.google.com/d/topic/python-ideas/-gsjDSht8VU/unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a href="mailto:python-ideas%2Bunsubscribe@googlegroups.com" target="_blank">python-ideas+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" rel="noreferrer" target="_blank">https://groups.google.com/d/optout</a>.<br>
</blockquote></div></div></div>