Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Steven D'Aprano
On Fri, Jan 04, 2019 at 01:01:51PM -0600, Abe Dillon wrote: > I keep coming back to this great video I've just watched it, its a bit slow to start but I agree with Abe that it is a great video. (And not just because the speaker agrees with me about 80 columns :-)

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Alex Walters
> -Original Message- > From: Python-ideas list=sdamon@python.org> On Behalf Of Abe Dillon > Sent: Friday, January 4, 2019 2:02 PM > To: Python-Ideas > Subject: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS > > I keep coming back to this great video

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Steven D'Aprano
On Fri, Jan 04, 2019 at 06:15:11PM -0600, Abe Dillon wrote: > Sure everyone knows what it means, but it's meaning is essentially useless > because the default assumption when you encounter a variable you don't > know, is that you shouldn't overwrite it. If you found a module-level > variable in Pa

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Steven D'Aprano
On Fri, Jan 04, 2019 at 01:01:51PM -0600, Abe Dillon wrote: > I keep coming back to this great video about > coding style, and one point in particular rings true to me: > ALL_CAPS_IS_OBNOXIOUS > > It destroys the visual flow of code Does it? This claim doesn't ring

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread David Mertz
Like everyone other than Abe in this thread, I find judicious use of CONSTANTS to be highly readable and useful. Yes, there is a little wiggle room about just how constant a constant has to be since Python doesn't have a straightforward way to create real constants. Very rarely I might change a va

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Chris Angelico
On Sat, Jan 5, 2019 at 1:11 PM Abe Dillon wrote: >> >> All-caps does *not* signify "don't override this". > > PEP-8 specifically says to use all caps to signify constants. What exactly do > you think the word "constant" means? I know very well Python doesn't support > actual constants and that a

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Abe Dillon
> > All-caps does *not* signify "don't override this". PEP-8 specifically says to use all caps to signify constants. What exactly do you think the word "constant" means? I know very well Python doesn't support actual constants and that anything can be overridden. Your example goes against the con

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Chris Angelico
On Sat, Jan 5, 2019 at 11:58 AM Abe Dillon wrote: > You made EMOTE_PATH all caps signifying it's a constant, then added a comment > saying that it "Can be overwritten prior to calling get_emote_list". > > So not only was your naming convention, on its own, insufficient to explain > the API of yo

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Noah Simon
Looking at the arguments regarding rendering existing code non-PEP-8-compliant, I think if we were to make this change it should be made in Python 4.0, or whatever the next backwards-incompatible version will be. However, personally I disagree with the fundamental assertion that ALL_CAPS is alw

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Abe Dillon
> > >> I will often use a module-level constant > >> for a file or path name; within the module, it is deliberately treated > >> as a constant, but if you import the module somewhere else, you could > >> reassign it before calling any functions in the module, and they'll > >> all use the changed pa

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Chris Angelico
On Sat, Jan 5, 2019 at 11:09 AM Abe Dillon wrote: >> >> Just to be clear here: you're trying to say that the ALL_CAPS_NAME >> convention is unnecessary, but you don't use constants. That kinda >> weakens your argument a bit :) > > > Just to be clear, I'm currently working in a Java shop where the

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Abe Dillon
Sure everyone knows what it means, but it's meaning is essentially useless because the default assumption when you encounter a variable you don't know, is that you shouldn't overwrite it. If you found a module-level variable in Pandas named cucumber, would you immediately assume you can write whate

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Cameron Simpson
On 05Jan2019 00:03, Michael Foord wrote: On Fri, 4 Jan 2019 at 19:02, Abe Dillon wrote: I keep coming back to this great video about coding style, and one point in particular rings true to me: ALL_CAPS_IS_OBNOXIOUS I really like the convention. It's nice and cle

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Cameron Simpson
On 04Jan2019 17:29, Abe Dillon wrote: How do you propose, instead, for the constantness of something to be indicated? That's a good question. I honestly don't use constants all that much, I like to move such things out to config files. I like there to be some default behaviour in the absence

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Abe Dillon
> > Just to be clear here: you're trying to say that the ALL_CAPS_NAME > convention is unnecessary, but you don't use constants. That kinda > weakens your argument a bit :) > Just to be clear, I'm currently working in a Java shop where the code-styles are to use all caps for constants, enums, and

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Michael Foord
On Fri, 4 Jan 2019 at 19:02, Abe Dillon wrote: > I keep coming back to this great video about > coding style, and one point in particular rings true to me: > ALL_CAPS_IS_OBNOXIOUS > I really like the convention. It's nice and clear and absolutely everyone knows what

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Abe Dillon
> > Changing this in the PEP will make an absurd amount of code which is > PEP-8 compliant no longer so. It depends on how we change it. There's plenty of room to compromise between explicitly mandating all caps and explicitly forbidding all caps. We could simply remove the section that says to u

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Chris Angelico
On Sat, Jan 5, 2019 at 10:29 AM Abe Dillon wrote: >> >> How do you propose, instead, for the constantness of something to be >> indicated? > > That's a good question. I honestly don't use constants all that much... Just to be clear here: you're trying to say that the ALL_CAPS_NAME convention is

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Abe Dillon
> > How do you propose, instead, for the constantness of something to be > indicated? That's a good question. I honestly don't use constants all that much, I like to move such things out to config files. For a constant like math.pi, it's never been caps, yet people know it's not a great idea to ch

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Chris Angelico
On Sat, Jan 5, 2019 at 10:10 AM Abe Dillon wrote: >> >> So you're saying we should prefer a future where it's an inconsistent mess? > > No. And please don't straw man. It's a very annoying argumentative tactic. I > prefer a future where all caps aren't used. I understand that the change I > prop

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Anders Hovmöller
> So you're saying we should prefer a future where it's an inconsistent mess? > No. And please don't straw man. It's a very annoying argumentative tactic. I > prefer a future where all caps aren't used. I understand that the change I > propose won't magically transport us there, but I don't thin

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Abe Dillon
> > So you're saying we should prefer a future where it's an inconsistent mess? No. And please don't straw man. It's a very annoying argumentative tactic. I prefer a future where all caps aren't used. I understand that the change I propose won't magically transport us there, but I don't think it j

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Anders Hovmöller
> Do you not have/use syntax highlighting? If not, why not? There's a right and > wrong tool for everything. In the case of visually differentiating various > kinds of code entities, the IDE is the right tool, all caps is not. This is an argument against: - the line length limit (because the I

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Chris Angelico
On Sat, Jan 5, 2019 at 9:59 AM Abe Dillon wrote: > > Do you not have/use syntax highlighting? If not, why not? There's a right and > wrong tool for everything. In the case of visually differentiating various > kinds of code entities, the IDE is the right tool, all caps is not. > All-caps is a s

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Abe Dillon
Do you not have/use syntax highlighting? If not, why not? There's a right and wrong tool for everything. In the case of visually differentiating various kinds of code entities, the IDE is the right tool, all caps is not. On Fri, Jan 4, 2019 at 1:13 PM Ryan Gonzalez wrote: > IMO it's good to have

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Bernardo Sulzbach
I disagree. Changing this in the PEP will make an absurd amount of code which is PEP-8 compliant no longer so. Also, the refactoring may not always be trivial as the lowercase names may already be in use. I'd suggest violating PEP-8 instead of trying to change it. _

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Anders Hovmöller
So you're saying we should prefer a future where it's an inconsistent mess? I agree with you that the C standard is ugly but it's.more important to have a standard than what that standard is. And we do have a strong standard today. -1 from me / Anders > On 4 Jan 2019, at 20:01, Abe Dillon w

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Ryan Gonzalez
IMO it's good to have some sort of visual differentiation between constants and normal values. A lot of camelCase-based style guides use a k prefix (e.g. kMyValue), but Python doesn't use it (other than PascalCase for classes). If there were to be an alternative to ALL_CAPS for constants, I guess m

[Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Abe Dillon
I keep coming back to this great video about coding style, and one point in particular rings true to me: ALL_CAPS_IS_OBNOXIOUS It destroys the visual flow of code and for what? To signify a global, constant, or Enum? Is that really so important? I don't think so. I thi

Re: [Python-ideas] Fixed point format for numbers with locale based separators

2019-01-04 Thread Steven D'Aprano
On Fri, Jan 04, 2019 at 03:57:53PM +0100, Łukasz Stelmach wrote: > Hi, > > I would like to present two pull requests[1][2] implementing fixed point > presentation of numbers and ask for comments. The first is mine. I > learnt about the second after publishing mine. Before I look at the implementa

[Python-ideas] Fixed point format for numbers with locale based separators

2019-01-04 Thread Łukasz Stelmach
Hi, I would like to present two pull requests[1][2] implementing fixed point presentation of numbers and ask for comments. The first is mine. I learnt about the second after publishing mine. The only format using decimal separator from locale data for float/complex/decimal numbers at the moment i