<div dir="ltr">[ChrisA]<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Nobody is saying that the *entire document* should be in all caps.</blockquote><br>I've never claimed as much. Most of the reasons all caps harm readability hold true whether you're talking about a single word or entire document.<br><br>[ChrisA]<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Are English paragraphs hard to read because tokens like "HTML" and "IBM" are in all-caps?</blockquote><br>Acronyms are a different use case for all caps. We can discuss the value proposition for those in another thread if you'd like.<br>I will say that I read my share of research papers where acronyms tend to see heavy use and, yes; it can harm readability.<br><br>[ChrisA]<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">With constants that are taken directly from C, consistency is<br>extremely helpful.</blockquote><div><br>That's fair. I can live with it. The <font face="monospace, monospace">socket</font> module was just an example. There are several examples of all caps that aren't inherited from other sources.<br><br>If <font face="monospace, monospace">datetime.MINYEAR</font> and <font face="monospace, monospace">datetime.MAXYEAR</font> were <font face="monospace, monospace">datetime.minyear </font>and <font face="monospace, monospace">datetime.maxyear</font> what do you think the consequences would be?<br>Do you really think it's less clear?<br>Do you think <font face="monospace, monospace">timedelta.min</font>, <font face="monospace, monospace">timedelta.max</font>, and <font face="monospace, monospace">timedelta.resolution</font> aren't clear enough? How about <font face="monospace, monospace">string.digits</font>? Should those shout at you that they're constants? Why or why not?<br><br>[ChrisA]<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Are you going to appeal to Google to have *their* style guide changed too?</blockquote><div><br></div><div>That's comparing apples and oranges. Python is an open language with an ideas forum about how to improve things. Google generally isn't open to my suggestions. Any given company I work with is much more likely to enforce PEP-8 than Google's style guides. As far as I know, getting Google to adopt a given idea isn't a precondition for the Python community accepting said idea.<br><br>[ChrisA]<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">treat PEP 8 as a guideline</blockquote></div><br>Again, that's not always an option.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 30, 2019 at 3:41 PM Chris Angelico <<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Jan 31, 2019 at 8:23 AM Abe Dillon <<a href="mailto:abedillon@gmail.com" target="_blank">abedillon@gmail.com</a>> wrote:<br>
><br>
> > Capitalizing constants may be slightly harder to read but constants in code are the minority and emphasizing them is precisely the point.<br>
><br>
> The question I'm trying to get everyone to actually think about:<br>
><br>
> Is the communication of constancy via ALL CAPS so important that it must be in PEP-8 despite the documented harm that all caps does to readability?<br>
><br>
> ttps://<a href="http://www.mity.com.au/blog/writing-readable-content-and-why-all-caps-is-so-hard-to-read" rel="noreferrer" target="_blank">www.mity.com.au/blog/writing-readable-content-and-why-all-caps-is-so-hard-to-read</a><br>
> <a href="https://en.wikipedia.org/wiki/All_caps#Readability" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/All_caps#Readability</a><br>
> <a href="https://uxmovement.com/content/all-caps-hard-for-users-to-read/" rel="noreferrer" target="_blank">https://uxmovement.com/content/all-caps-hard-for-users-to-read/</a><br>
> <a href="https://practicaltypography.com/all-caps.html" rel="noreferrer" target="_blank">https://practicaltypography.com/all-caps.html</a><br>
<br>
Nobody is saying that the *entire document* should be in all caps.<br>
This is a specific token, a specific identifier. Are English<br>
paragraphs hard to read because tokens like "HTML" and "IBM" are in<br>
all-caps?<br>
<br>
> If socket.AF_INET6 were socket.af_inet6 would you consider re-binding that variable? Would you be worried that other code will re-bind it? Can you measure the value of the information conveyed by all-caps? Are you so sure that it's as important as you think?<br>
><br>
<br>
With constants that are taken directly from C, consistency is<br>
extremely helpful. Why is it called AF_INET6? Because it has exactly<br>
the same as AF_INET6 in C, or any other language that also has derived<br>
its socket handling from BSD sockets. (Which, for reference, is<br>
basically every language that has any sort of socket support.)<br>
<br>
> I've gotten a lot of responses like, "If you don't like it just ignore PEP-8, it's not mandatory".<br>
> A) It is mandatory in many cases.<br>
<br>
That is not PEP 8's problem. The document stipulates that it is the<br>
standard for the Python standard library, nothing else. Are you going<br>
to appeal to Google to have *their* style guide changed too? A lot of<br>
people have adopted Google's style guide, and it explicitly says that<br>
module level constants *must* be in all caps.<br>
<br>
> B) We could just as easily NOT prescribe all caps in PEP-8 but still allow it. In other words: you can use all caps if you want to but it's not mandatory or in PEP-8. I would like to discourage its use, but we don't have to go so far. That way nobody has to violate PEP-8.<br>
><br>
<br>
I don't think PEP 8 actually mandates that *all* constants be written<br>
in all caps. It says "usually". But you have many options here -<br>
ignore PEP 8, treat PEP 8 as a guideline, or just accept that<br>
ALL_CAPS_CONSTANTS actually do carry useful information in their<br>
names.<br>
<br>
ChrisA<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>
</blockquote></div>