<div dir="auto">There is an unfortunate ambiguity in using a character that means "not" as a word separator:<div dir="auto"><br></div><div dir="auto"> nuke.do<span style="font-family:sans-serif">¬launch()</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">"But... I called the method which explicitly did *not* launch the nuke!"</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">Stephan</span></div><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">Op 19 nov. 2017 11:05 schreef "Steve Barnes" <<a href="mailto:gadgetsteve@live.co.uk">gadgetsteve@live.co.uk</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text"><br>
<br>
On 19/11/2017 05:01, Nick Timkovich wrote:<br>
> Python does not use U+2010 HYPHEN for the minus operator, it uses the<br>
> U+002D (-) HYPHEN-MINUS.<br>
><br>
> In some monospace fonts, there is a subtle difference between U+002D,<br>
> U+2013 EN DASH, and U+2014 EM DASH, but it's usually hard to tell them<br>
> *all* apart.<br>
><br>
> If you want to make a proposal, I'd suggest that you limit it to<br>
> allowing the U+2010 HYPHEN to be used for names. U+002D simply cannot be<br>
> changed because it would break billions of lines of code.<br>
><br>
> On Sat, Nov 18, 2017 at 10:44 PM, Mikhail V <<a href="mailto:mikhailwas@gmail.com">mikhailwas@gmail.com</a><br>
</div><div class="quoted-text">> <mailto:<a href="mailto:mikhailwas@gmail.com">mikhailwas@gmail.com</a>>> wrote:<br>
><br>
> On Sun, Nov 19, 2017 at 3:42 AM, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a><br>
</div><div class="elided-text">> <mailto:<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>>> wrote:<br>
><br>
> > For anyone tempted to suggest "What about multiple underscores<br>
> > indicating continuation of the variable name?", that's still a<br>
> > compatibility problem due to the unary minus operator:<br>
> ><br>
> > >>> my--variable<br>
> > 2<br>
> > >>> my---variable<br>
> > 0<br>
><br>
> That seems to be another showcase of misfotune that Python<br>
> uses hyphen for minus operator. I know it is not language designer's<br>
> fault, because basic ASCII simply did not not include minus character.<br>
> But do you realise that the **current** problem you are adressing is<br>
> that<br>
> font designers forgot to make the minus character (in monospaced font)<br>
> distinctive from the hyphen character?<br>
><br>
> Well, what can I say, I just think it should be a reason to make a<br>
> collective complain to font providers, but not that you should silently<br>
> accept this and adopt the language design to someone's sloppy font<br>
> design.<br>
><br>
> As an aid for monospace die-hards, to minimise the confusion one could<br>
> publish a style-guide that recommends to disclose the minus operator<br>
> (currently<br>
> hyphen char) in spaces, like a - b, and probably disallow the new<br>
> proposed<br>
> hyphen character in the beginning of the identifiers.<br>
> That would still leave potential for confusion because you cant'<br>
> force everyone<br>
> to follow style-guides, but one should struggle to break from this<br>
> cycle anyway.<br>
><br>
> ><br>
> > Would hyphens in variable names improve readability sometimes?<br>
><br>
> For reading code, indeed, always and very much. Of course not in case<br>
> I would be forced<br>
> to use monospaced font with a similar minus and hyphen. But<br>
> in that case I am already accepting the level of readability of<br>
> 12th century, so this would not make things much worse, and I<br>
> would simply put spaces around the minus operator and try to highlight<br>
> it with some strong color.<br>
><br>
</div>How about allowing ¬, (ASCII 172, U+00ac, NOT sign), in variable names<br>
as in my¬variable - it has the advantages that:<br>
<br>
- it is visually distinguishable even in mono-spaced fonts,<br>
(personally I use mono-spaced all of the time when programming but I<br>
know that I am a dinosaur),<br>
- is actually on many keyboards as a single character, (I don't know<br>
of any which actually produce different characters for minus on the<br>
numeric keypad and hyphen elsewhere), so can be typed as a single key press,<br>
- Is generally unused AFAIK other than in papers about logic,<br>
- It is currently unused in the Python language.<br>
<br>
This might upset some who would like use it to replace the unary not<br>
operator but I suspect that it would be far fewer people than the<br>
potential breakages discussed so far.<br>
<font color="#888888"><br>
--<br>
Steve (Gadget) Barnes<br>
Any opinions in this message are my personal opinions and do not reflect<br>
those of my employer.<br>
<br>
---<br>
This email has been checked for viruses by AVG.<br>
<a href="http://www.avg.com" rel="noreferrer" target="_blank">http://www.avg.com</a><br>
</font><div class="elided-text"><br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</div></blockquote></div><br></div></div>