Re: Python indentation (3 spaces)

2018-11-11 Thread Peter J. Holzer
On 2018-10-25 12:59:18 +0200, Antoon Pardon wrote: > On 20-10-18 14:38, Peter J. Holzer wrote: > > On 2018-10-16 06:37:56 +1100, Chris Angelico wrote: > >> On Tue, Oct 16, 2018 at 6:34 AM Peter J. Holzer wrote: > >>> On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote: > On 13-10-18 09:37, Pete

Re: Python indentation (3 spaces)

2018-10-25 Thread Antoon Pardon
On 20-10-18 14:38, Peter J. Holzer wrote: > On 2018-10-16 06:37:56 +1100, Chris Angelico wrote: >> On Tue, Oct 16, 2018 at 6:34 AM Peter J. Holzer wrote: >>> On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote: On 13-10-18 09:37, Peter J. Holzer wrote: > On 2018-10-09 09:55:34 +0200, Antoon

Re: Python indentation (3 spaces)

2018-10-20 Thread Peter J. Holzer
change, > and it shows up. If any change "shows up" (i.e., is rejected by the pre-commit hook of your version control system) you can't change anything which makes using a version control system rather pointless. So you still need to distinguish between "intended changes" a

Re: Python indentation (3 spaces)

2018-10-15 Thread Ethan Furman
On 10/15/2018 12:37 PM, Chris Angelico wrote: On Tue, Oct 16, 2018 at 6:34 AM Peter J. Holzer wrote: On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote: Spaces that replaced a tab by accident, are easy to catch too. They are all those lines that show up when you do a diff with the previous ve

Re: Python indentation (3 spaces)

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 9:16 AM D'Arcy Cain wrote: > > On 10/15/18 5:54 PM, Gregory Ewing wrote: > > Cameron Simpson wrote: > >> I can't express how pleasing it is to see the traditional vi-vs-emacs > >> wars supplanted by emacs-vs-emacs :-) > > > > We're the People's Front of Emacs, not the Emacs

Re: Python indentation (3 spaces)

2018-10-15 Thread D'Arcy Cain
On 10/15/18 5:54 PM, Gregory Ewing wrote: > Cameron Simpson wrote: >> I can't express how pleasing it is to see the traditional vi-vs-emacs >> wars supplanted by emacs-vs-emacs :-) > > We're the People's Front of Emacs, not the Emacs People's Front! I thought we were the People's Emacs Front. --

Re: Python indentation (3 spaces)

2018-10-15 Thread Gregory Ewing
Cameron Simpson wrote: I can't express how pleasing it is to see the traditional vi-vs-emacs wars supplanted by emacs-vs-emacs :-) We're the People's Front of Emacs, not the Emacs People's Front! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python indentation (3 spaces)

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 8:03 AM Cameron Simpson wrote: > > > [ Marko and Rhdri discussing emacs indentation modes ... ] > > I can't express how pleasing it is to see the traditional vi-vs-emacs > wars supplanted by emacs-vs-emacs :-) > Which editor should I use - vi in

Re: Python indentation (3 spaces)

2018-10-15 Thread Cameron Simpson
[ Marko and Rhdri discussing emacs indentation modes ... ] I can't express how pleasing it is to see the traditional vi-vs-emacs wars supplanted by emacs-vs-emacs :-) Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

Re: Python indentation (3 spaces)

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 6:34 AM Peter J. Holzer wrote: > > On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote: > > On 13-10-18 09:37, Peter J. Holzer wrote: > > > On 2018-10-09 09:55:34 +0200, Antoon Pardon wrote: > > >> On 08-10-18 19:43, Peter J. Holzer wrote: > > >>> In practice it doesn't work

Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote: > On 13-10-18 09:37, Peter J. Holzer wrote: > > On 2018-10-09 09:55:34 +0200, Antoon Pardon wrote: > >> On 08-10-18 19:43, Peter J. Holzer wrote: > >>> In practice it doesn't work in my experience. There is always someone in > >>> a team who was "j

Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
are. > > If you used two-space tab stops and I used (the normal :-) eight, > comfortable indentations for you would rapidly become uncomfortably large > indentations for me. I'd care about that. Buy a bigger monitor :-). On a more serious note, I think the number of indentatio

Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 09:49:12 +1100, Cameron Simpson wrote: > On 15Oct2018 00:33, Peter J. Holzer wrote: > > On 2018-10-15 09:06:11 +1100, Chris Angelico wrote: > > > On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: > > > > Chris Angelico : > > > > > Ta

Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James
On 15/10/18 16:41, Marko Rauhamaa wrote: Rhodri James : On 15/10/18 12:28, Marko Rauhamaa wrote: Try running emacs -q abc.c and observe the indentation depth. """User Option: c-basic-offset This style variable holds the basic offset between indentation level

Re: Python indentation (3 spaces)

2018-10-15 Thread Marko Rauhamaa
Rhodri James : > On 15/10/18 12:28, Marko Rauhamaa wrote: >> Try running >> >> emacs -q abc.c >> >> and observe the indentation depth. > > """User Option: c-basic-offset > > This style variable holds the basic offset between

Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James
On 15/10/18 12:28, Marko Rauhamaa wrote: Rhodri James : On 15/10/18 05:45, Marko Rauhamaa wrote: The two-space indentation is the out-of-the-box default for emacs. Ahem. It's the default for certain C styles. It's not even the default for C-mode itself, which is 4. You must be

Re: Python indentation (3 spaces)

2018-10-15 Thread Antoon Pardon
ce your screen >>>> or your choices. >>> Theoretically I would agree with you: Just use a single tab per >>> indentation level and let the user decide whether that's displayed as 2, >>> 3, 4, or 8 spaces or 57 pixels or whatever. >>> >>>

Re: Python indentation (3 spaces)

2018-10-15 Thread Marko Rauhamaa
Rhodri James : > On 15/10/18 05:45, Marko Rauhamaa wrote: >> The two-space indentation is the out-of-the-box default for emacs. > > Ahem. It's the default for certain C styles. It's not even the default > for C-mode itself, which is 4. You must be running a differe

Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James
On 15/10/18 05:45, Marko Rauhamaa wrote: Chris Angelico : I'm saying I have never seen is this: On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: However, it is trumped by an older convention whereby the indentation levels go as follows: 0: 1: SPC SPC 2: SPC SPC SP

Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James
On 14/10/18 09:06, Peter J. Holzer wrote: On 2018-10-14 00:45:49 +, Grant Edwards wrote: On 2018-10-13, Peter J. Holzer wrote: For "just use tabs" to work, all of those tools would have to magically recognize that they're looking at Python source and adjust the tab size accordingly. Tha

Re: Python indentation (3 spaces)

2018-10-15 Thread Marko Rauhamaa
Chris Angelico : > On Mon, Oct 15, 2018 at 3:51 PM Marko Rauhamaa wrote: > I don't understand your point here. It prints a letter, then some > spaces, then a tab, then another letter. On my terminal, that displays > the tab by advancing to the next tab position. If I highlight to > select, it's o

Re: Python indentation (3 spaces)

2018-10-14 Thread Chris Angelico
On Mon, Oct 15, 2018 at 3:51 PM Marko Rauhamaa wrote: > The two-space indentation is the out-of-the-box default for emacs. > However, the tab collapsing principle is a universal default. If you go > against it, you will have to educate more tools than your editor. For > example, try

Re: Python indentation (3 spaces)

2018-10-14 Thread Marko Rauhamaa
Chris Angelico : > I'm saying I have never seen is this: > > On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: >> However, it is trumped by an older >> convention whereby the indentation levels go as follows: >> >>0: >>1: SPC SPC >>

Re: Python indentation (3 spaces)

2018-10-14 Thread Chris Angelico
character. The convention that I'm saying I have never seen is this: On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: > However, it is trumped by an older > convention whereby the indentation levels go as follows: > >0: >1: SPC SPC >2: SPC SPC SPC SPC >

Re: Python indentation (3 spaces)

2018-10-14 Thread Alan Bawden
mn files do show up occasionally. So when you say: I've literally NEVER come across this as a convention. Not a single file that I have ever worked with has used it. Where is this convention from? I feel that there _must_ be some misunderstanding here. Maybe you misinterpreted

Re: Python indentation (3 spaces)

2018-10-14 Thread Chris Angelico
On Mon, Oct 15, 2018 at 9:56 AM Alan Bawden wrote: > In my experience this is a very common way to assume that tabs will be > interpreted. Virtually every source-code file I have encountered since the > mid 1970s (for any programming language or operating system) has assumed > either this convent

Re: Python indentation (3 spaces)

2018-10-14 Thread Alan Bawden
Chris Angelico writes: > On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: > > Chris Angelico : ... > > That *could* be the situation. However, it is trumped by an older > > convention whereby the indentation levels go as follows: > > > >0: > >

Re: Python indentation (3 spaces)

2018-10-14 Thread Cameron Simpson
On 15Oct2018 00:33, Peter J. Holzer wrote: On 2018-10-15 09:06:11 +1100, Chris Angelico wrote: On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: > Chris Angelico : > > Tabs for indentation have semantic meaning. Top-level has zero tabs. > > One indentation level is represe

Re: Python indentation (3 spaces)

2018-10-14 Thread Peter J. Holzer
On 2018-10-15 09:06:11 +1100, Chris Angelico wrote: > On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: > > Chris Angelico : > > > Tabs for indentation have semantic meaning. Top-level has zero tabs. > > > One indentation level is represented by one tab. Two indenta

Re: Python indentation (3 spaces)

2018-10-14 Thread Chris Angelico
On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: > > Chris Angelico : > > > Tabs for indentation have semantic meaning. Top-level has zero tabs. > > One indentation level is represented by one tab. Two indentation > > levels? Two tabs. It's about as perfe

Re: Python indentation (3 spaces)

2018-10-14 Thread Marko Rauhamaa
Chris Angelico : > Tabs for indentation have semantic meaning. Top-level has zero tabs. > One indentation level is represented by one tab. Two indentation > levels? Two tabs. It's about as perfect a representation as you could > hope for. If you like your indentation levels to b

Re: Python indentation (3 spaces)

2018-10-14 Thread Chris Angelico
t have a different tab width > >>> per language, but a different tab width per user. > >> > >> You work in a different environment than I do. for me, tab width > >> varies from one project to another (sometimes even in the same > >> language). I d

Re: Python indentation (3 spaces)

2018-10-14 Thread Grant Edwards
>> You work in a different environment than I do. for me, tab width >> varies from one project to another (sometimes even in the same >> language). I don't get to pick just one tab width. > > But if you use only tabs for indentation, the tab width setting simply

Re: Python indentation (3 spaces)

2018-10-14 Thread Peter J. Holzer
h > varies from one project to another (sometimes even in the same > language). I don't get to pick just one tab width. You probably don't because you use spaces, not tabs. If everybody used tabs, why would anyone care about your tab width? Unless they look over your shoulder while yo

Re: Python indentation (3 spaces)

2018-10-14 Thread Christian Gollwitzer
ick just one tab width. But if you use only tabs for indentation, the tab width setting simply does not matter. I'm in favour of using only tabs. There is a disadvantage only if you try to align something which is NOT an indentation level, e.g. when there are big string constants or list

Re: Python indentation (3 spaces)

2018-10-13 Thread Grant Edwards
On 2018-10-13, Peter J. Holzer wrote: > >> For "just use tabs" to work, all of those tools would have to >> magically recognize that they're looking at Python source and adjust >> the tab size accordingly. That isn't going to happen. > > Well, no. The idea of "just use tabs" isn't have a differen

Re: Python indentation (3 spaces)

2018-10-13 Thread Peter J. Holzer
cally I would agree with you: Just use a single tab per > > indentation level and let the user decide whether that's displayed as 2, > > 3, 4, or 8 spaces or 57 pixels or whatever. > > > > In practice it doesn't work in my experience. There is always someone in

Re: Python indentation (3 spaces)

2018-10-13 Thread Peter J. Holzer
On 2018-10-08 20:13:38 +, Grant Edwards wrote: > On 2018-10-08, Peter J. Holzer wrote: > > Theoretically I would agree with you: Just use a single tab per > > indentation level and let the user decide whether that's displayed > > as 2, 3, 4, or 8 spaces or 57 pixe

Re: Python indentation (3 spaces)

2018-10-09 Thread Antoon Pardon
able to view code with any indentation that >> makes sense for you. If someone submits code and says "it looks >> tidiest in Times New Roman 12/10pt", I'm sure you'd recommend making >> sure it doesn't matter [1]; if someone submits code and says "you h

Re: Python indentation (3 spaces)

2018-10-08 Thread Chris Angelico
On Tue, Oct 9, 2018 at 9:06 AM Marko Rauhamaa wrote: > > Thomas Jollans : > > > On 08/10/2018 08:31, Marko Rauhamaa wrote: > >> Where I work (and at home), the only control character that is allowed > >> in source code is LF. > > > > No tolerance for form feeds? > > None whatsoever. > > CR is ok b

Re: Python indentation (3 spaces)

2018-10-08 Thread Marko Rauhamaa
Thomas Jollans : > On 08/10/2018 08:31, Marko Rauhamaa wrote: >> Where I work (and at home), the only control character that is allowed >> in source code is LF. > > No tolerance for form feeds? None whatsoever. CR is ok but only if immediately followed by BEL. That way typing source code gives o

Re: Python indentation (3 spaces)

2018-10-08 Thread Thomas Jollans
On 08/10/2018 08:31, Marko Rauhamaa wrote: Chris Angelico : How wide my indents are on my screen shouldn't influence your screen or your choices. Where I work (and at home), the only control character that is allowed in source code is LF. No tolerance for form feeds? -- https://mail.python

Re: Python indentation (3 spaces)

2018-10-08 Thread Grant Edwards
On 2018-10-08, Peter J. Holzer wrote: > Theoretically I would agree with you: Just use a single tab per > indentation level and let the user decide whether that's displayed > as 2, 3, 4, or 8 spaces or 57 pixels or whatever. > > In practice it doesn't work in my expe

Re: Python indentation (3 spaces)

2018-10-08 Thread Marko Rauhamaa
Chris Angelico : > How wide my indents are on my screen shouldn't influence your screen > or your choices. Where I work (and at home), the only control character that is allowed in source code is LF. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Python indentation (3 spaces)

2018-10-08 Thread Chris Angelico
nd you should be able to view code with any indentation that > > makes sense for you. If someone submits code and says "it looks > > tidiest in Times New Roman 12/10pt", I'm sure you'd recommend making > > sure it doesn't matter [1]; if someone submits co

Re: Python indentation (3 spaces)

2018-10-08 Thread Peter J. Holzer
On 2018-10-08 10:36:21 +1100, Chris Angelico wrote: > TBH, I think that tab width should be up to the display, just like the > font. You're allowed to view code in any font that makes sense for > you, and you should be able to view code with any indentation that > makes sense fo

Re: Python indentation (correct behaviour) (was: Python indentation (3 spaces))

2018-10-08 Thread Peter J. Holzer
On 2018-10-08 18:06:51 +1100, Ben Finney wrote: > Cameron Simpson writes: > > What I do wish was that I had a vim mode that highlighted an indent > > column so I can line up indented code with its controlling top line. > > For Vim: https://github.com/nathanaelkane/vim-indent-guides>. Nice.

Re: Python indentation (3 spaces)

2018-10-08 Thread Rhodri James
e of switching to 3 space indentation, which we could do right now with no need to change a single thing, is that it would all seem to work perfectly well for a while. It wouldn't take long for people to get irritated with actually typing three spaces though, and to reprogram their Tab keys to thre

Re: Python indentation (correct behaviour) (was: Python indentation (3 spaces))

2018-10-08 Thread Cameron Simpson
com/antonj/Highlight-Indentation-for-Emacs> The latter is used by default in Elpy, an excellent Python development suite https://elpy.readthedocs.io/>. Thank you! - Cameron -- https://mail.python.org/mailman/listinfo/python-list

Re: Python indentation (3 spaces)

2018-10-08 Thread Thomas Jollans
On 08/10/2018 03:13, Gene Heskett wrote: On Sunday 07 October 2018 19:20:57 Dennis Lee Bieber wrote: On Sun, 7 Oct 2018 14:19:15 -0400, Gene Heskett declaimed the following: But that automatically assumes one is running in a windows environment. I don't allow it on the premises if I own the

Re: Python indentation (3 spaces)

2018-10-08 Thread Ben Finney
Terry Reedy writes: > You assumption that a tab means '4 spaces' is wrong. A tab means > 'jump to the next tab stop'. On 10 char/inch US typewriters, tab > stops were initially set to every 5 spaces or 1/2 inch. In terminals > and code editors, virtual tab stops were often set to every 8 space

Python indentation (correct behaviour) (was: Python indentation (3 spaces))

2018-10-08 Thread Ben Finney
Cameron Simpson writes: > What I do wish was that I had a vim mode that highlighted an indent > column so I can line up indented code with its controlling top line. For Vim: https://github.com/nathanaelkane/vim-indent-guides>. For Emacs: https://github.com/antonj/Highlight-Indentation-

Re: Python indentation (3 spaces)

2018-10-07 Thread Gene Heskett
On Sunday 07 October 2018 19:20:57 Dennis Lee Bieber wrote: > On Sun, 7 Oct 2018 14:19:15 -0400, Gene Heskett > > declaimed the following: > >But that automatically assumes one is running in a windows > > environment. I don't allow it on the premises if I own the machine. > > Are there good, alte

Re: Python indentation (3 spaces)

2018-10-07 Thread Gene Heskett
ay 07 October 2018 17:36:34 Chris Angelico wrote: > > > > > On Mon, Oct 8, 2018 at 8:27 AM Gene Heskett > > > > > > > > > > > > > wrote: > > > > [...]> > > > > > > > > > Okay, but I'm trying to

Re: Python indentation (3 spaces)

2018-10-07 Thread Cameron Simpson
On 08Oct2018 09:47, Chris Angelico wrote: On Mon, Oct 8, 2018 at 9:46 AM Gene Heskett wrote: On Sunday 07 October 2018 18:29:21 Chris Angelico wrote: > Ah. Fair enough, then. Basically, you want the Python equivalent of > "gcc -Wall -Wpedantic". > Is there such a critter? Not really; there's

Re: Python indentation (3 spaces)

2018-10-07 Thread Chris Angelico
e in any font that makes sense for you, and you should be able to view code with any indentation that makes sense for you. If someone submits code and says "it looks tidiest in Times New Roman 12/10pt", I'm sure you'd recommend making sure it doesn't matter [1]; if som

Re: Python indentation (3 spaces)

2018-10-07 Thread Terry Reedy
On 10/7/2018 2:35 PM, Ryan Johnson wrote: The logic is that all the text editors that are designed to work with Python code will KNOW to replace tab input with 3 characters, while still parsing the \t tab character as 4 characters; What do you mean by 'parsing a tab character as 4 characters

Re: Re: Python indentation (3 spaces)

2018-10-07 Thread Peter via Python-list
It's also useful to be aware of the standard tabnanny module for "Detection of ambiguous indentation". Very useful for highlighting problems with tabs and spaces. Peter On 8/10/2018 2:32 AM, Terry Reedy wrote: On 10/5/2018 11:30 PM, Ryan Johnson wrote: The point that OP is

Re: Python indentation (3 spaces)

2018-10-07 Thread Chris Angelico
on, Oct 8, 2018 at 8:27 AM Gene Heskett > > > > > > wrote: > > > [...]> > > > > > > > Okay, but I'm trying to understand why you're referencing this in > > > > this thread about indentation. That would imply that you at least >

Re: Python indentation (3 spaces)

2018-10-07 Thread Gene Heskett
> > > > Okay, but I'm trying to understand why you're referencing this in > > > this thread about indentation. That would imply that you at least > > > have reason to suspect that the problem is indentation. > > > > > > ChrisA > > >

Re: Python indentation (3 spaces)

2018-10-07 Thread Chris Angelico
On Mon, Oct 8, 2018 at 9:26 AM Gene Heskett wrote: > > On Sunday 07 October 2018 17:36:34 Chris Angelico wrote: > > > On Mon, Oct 8, 2018 at 8:27 AM Gene Heskett > wrote: > [...]> > > Okay, but I'm trying to understand why you're referencing this in this

Re: Python indentation (3 spaces)

2018-10-07 Thread Gene Heskett
On Sunday 07 October 2018 17:36:34 Chris Angelico wrote: > On Mon, Oct 8, 2018 at 8:27 AM Gene Heskett wrote: [...]> > Okay, but I'm trying to understand why you're referencing this in this > thread about indentation. That would imply that you at least have > reason to

Re: Python indentation (3 spaces)

2018-10-07 Thread Bev in TX
> On Oct 7, 2018, at 4:30 PM, Gene Heskett wrote: > >> Free for Linux, Macs and Windows ... >> https://code.visualstudio.com/Download >> >> > > >> >> Bev in TX > > Thank

Re: Python indentation (3 spaces)

2018-10-07 Thread Chris Angelico
tworks themselves, everyone's desktop computers... the works. Also, that *still* has nothing to do with the matter at hand. There's no problems running some version of IDLE on any release of Debian that I've ever used. > > I don't understand what any of this has to d

Re: Python indentation (3 spaces)

2018-10-07 Thread Gene Heskett
On Sunday 07 October 2018 14:30:07 Bev in TX wrote: > > On Oct 7, 2018, at 1:19 PM, Gene Heskett wrote: > >>> That > >>> said, there is an easy fix for tab misuse: in Visual Studio Code, > >>> you can replace all Tabs with Spaces by highlighting the entire > >>> code block, hitting Tab once and

Re: Python indentation (3 spaces)

2018-10-07 Thread Gene Heskett
nd will see if it > > will call my attention to bad coding. I'll be most appreciative if > > it can find something that will make this code Just Work(TM). Thank > > you for mentioning it, Terry. > > I don't understand what any of this has to do with anything. Do y

Re: Python indentation (3 spaces)

2018-10-07 Thread Chris Angelico
On Mon, Oct 8, 2018 at 5:39 AM Ryan Johnson wrote: > > > What library? From where? > > It was a GitHub repository for a zebra scanner (barcode scanner) module (and > sorry for calling it a library; I don’t recall if it was a library or module). > > The logic is that all the text editors that are

RE: Python indentation (3 spaces)

2018-10-07 Thread Ryan Johnson
, 2018 10:35 AM To: python-list@python.org Subject: Re: Python indentation (3 spaces) On 10/5/2018 11:30 PM, Ryan Johnson wrote: > The point that OP is trying to make is that a fixed standard that is > distinguishable from the even-spacing Tab-length convention in code and > text editor

Re: Python indentation (3 spaces)

2018-10-07 Thread Chris Angelico
ank you for > mentioning it, Terry. I don't understand what any of this has to do with anything. Do you suspect that your code is fraught with indentation bugs? If so, pretty much ANY Python-aware editor will help you, as will Python 3.x, as will Python2 with the "-tt" option. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Python indentation (3 spaces)

2018-10-07 Thread Bev in TX
> On Oct 7, 2018, at 1:19 PM, Gene Heskett wrote: > >>> >>> That >>> said, there is an easy fix for tab misuse: in Visual Studio Code, >>> you can replace all Tabs with Spaces by highlighting the entire code >>> block, hitting Tab once and Shift-Tab after. > > But that automatically assumes

Re: Python indentation (3 spaces)

2018-10-07 Thread Gene Heskett
On Sunday 07 October 2018 11:32:21 Terry Reedy wrote: > On 10/5/2018 11:30 PM, Ryan Johnson wrote: > > The point that OP is trying to make is that a fixed standard that is > > distinguishable from the even-spacing Tab-length convention in code > > and text editors will establish a level of trust b

Re: Python indentation (3 spaces)

2018-10-07 Thread Terry Reedy
s TabError: inconsistent use of tabs and spaces in indentation if 1: if 2: # 4 space indent b = 2 1 tab indent In 2.x, this runs, but if you run it from IDLE, you get a message suggesting that you change the tab to spaces and telling you how to do so. This is because IDLE runs your

Re: Python indentation (3 spaces)

2018-10-07 Thread Terry Reedy
On 10/5/2018 11:30 PM, Ryan Johnson wrote: The point that OP is trying to make is that a fixed standard that is distinguishable from the even-spacing Tab-length convention in code and text editors will establish a level of trust between the end developer and upstream developers or co-developers w

Re: Python indentation (3 spaces)

2018-10-07 Thread Terry Reedy
On 10/6/2018 3:47 PM, C W Rose via Python-list wrote: Ryan Johnson wrote: The point that OP is trying to make is that a fixed standard that is distinguishable from the even-spacing Tab-length convention in code and text editors will establish a level of trust between the end developer and upstr

Re: Python indentation (3 spaces)

2018-10-07 Thread C W Rose via Python-list
Ryan Johnson wrote: > The point that OP is trying to make is that a fixed standard that is > distinguishable from the even-spacing Tab-length convention in code and > text editors will establish a level of trust between the end developer and > upstream developers or co-developers who may not have

Re: Python indentation (3 spaces)

2018-10-06 Thread Chris Green
Terry Reedy wrote: > On 10/5/2018 4:48 PM, ts9...@gmail.com wrote: > > I am new to Python programming but have significant SQL and C experience. > My simple question is,"Why not standardize Python indentations to 3 spaces > instead of 4 in order to avoid potential programming errors associated

Re: Python indentation (3 spaces)

2018-10-05 Thread Ryan Johnson
The point that OP is trying to make is that a fixed standard that is distinguishable from the even-spacing Tab-length convention in code and text editors will establish a level of trust between the end developer and upstream developers or co-developers who may not have the same development environm

Re: Python indentation (3 spaces)

2018-10-05 Thread Terry Reedy
On 10/5/2018 4:48 PM, ts9...@gmail.com wrote: I am new to Python programming but have significant SQL and C experience. My simple question is,"Why not standardize Python indentations to 3 spaces instead of 4 in order to avoid potential programming errors associated with using "TAB" instead

Re: Python indentation (3 spaces)

2018-10-05 Thread Chris Angelico
n millimeters are also entirely viable, I don't think there's any way to define this perfectly consistently. It depends entirely on the particular setup that you have, and therefore is perfect for a per-project style guide. But hey. It's an instant syntax error. It's not exactl

Re: Python indentation (3 spaces)

2018-10-05 Thread Karsten Hilbert
) > > looks indistinguishable from > > for a in x: > if a: > b() > c() > > but the former is a syntax error in Python 3. > > If use 3-space indentation this error is more visible: > > for a in x: >if a: > b() > <-tab

Re: Python indentation (3 spaces)

2018-10-05 Thread Serhiy Storchaka
but the former is a syntax error in Python 3. If use 3-space indentation this error is more visible: for a in x: if a: b() <-tab-->c() -- https://mail.python.org/mailman/listinfo/python-list

Re: Python indentation (3 spaces)

2018-10-05 Thread Chris Angelico
On Sat, Oct 6, 2018 at 6:51 AM wrote: > >I am new to Python programming but have significant SQL and C experience. > My simple question is,"Why not standardize Python indentations to 3 spaces > instead of 4 in order to avoid potential programming errors associated with > using "TAB" instead

Python indentation (3 spaces)

2018-10-05 Thread ts9564
I am new to Python programming but have significant SQL and C experience. My simple question is,"Why not standardize Python indentations to 3 spaces instead of 4 in order to avoid potential programming errors associated with using "TAB" instead of 4 spaces?" Thoughts? Thomas -- https://mail.

Re: I'd like to use "semantic indentation"

2017-09-30 Thread Paul Rubin
Chris Angelico writes: > USA: > Alabama: > Abbeville > Addison > ... > and then, as Paul suggested, write a simple parser to read it. That looks like YAML, which there's already a library for. I'm not crazy about it but it might be an ok choice for this. -- https://m

Re: I'd like to use "semantic indentation"

2017-09-30 Thread bartc
town( 'Avondale ) town( 'Benson' ) using "semantic indentation". It seems I can't do this with Python. Is there any workaround? def country(x): print("C:",x) def state(x): print("S:",x) def town(x): print("T:",x)

Re: I'd like to use "semantic indentation"

2017-09-30 Thread Chris Angelico
town( 'Apache Junction' ) > town( 'Avondale ) > town( 'Benson' ) > > using "semantic indentation". > > It seems I can't do this with Python. > > Is there any workaround? If the indentation has semantic significa

Re: I'd like to use "semantic indentation"

2017-09-30 Thread Paul Rubin
r...@zedat.fu-berlin.de (Stefan Ram) writes: > I would like to write source code similar to: > country( 'USA' ) > state( 'Alabama' ) Aside from the workaround that I mentioned, this looks more like data than code. Maybe you really want to create a nested structure (dictionaries, JSON, XML or

Re: I'd like to use "semantic indentation"

2017-09-30 Thread Paul Rubin
r...@zedat.fu-berlin.de (Stefan Ram) writes: > I would like to write source code similar to: > country( 'USA' ) > state( 'Alabama' ) ... > It seems I can't do this with Python. Is there any workaround? _= country( 'USA' ) _= state( 'Alabama' ) _= town( 'Abbeville' ) _= town

Re: I'd like to use "semantic indentation"

2017-09-30 Thread Joonas Liik
On 30 September 2017 at 21:12, Stefan Ram wrote: > I would like to write source code similar to: > > country( 'USA' ) > state( 'Alabama' ) > town( 'Abbeville' ) > town( 'Addison' ) > state( 'Arizona' ) > town( 'Apache Junction' ) > town( 'Avondale ) > town( 'Benson' ) >

Re: Scala considering significant indentation like Python

2017-05-25 Thread Rustom Mody
On Wednesday, May 24, 2017 at 8:01:53 PM UTC+5:30, Rustom Mody wrote: > On Wednesday, May 24, 2017 at 2:14:15 AM UTC+5:30, Ben Finney wrote: > > Grant Edwards grant.b.edwards writes: > > > > > On 2017-05-23, Michael Torrie wrote: > > > > Sometimes things get longer than a page (like a class defin

Re: Scala considering significant indentation like Python

2017-05-24 Thread Rustom Mody
On Wednesday, May 24, 2017 at 2:14:15 AM UTC+5:30, Ben Finney wrote: > Grant Edwards grant.b.edwards writes: > > > On 2017-05-23, Michael Torrie wrote: > > > Sometimes things get longer than a page (like a class definition). > > > > A nice folding mode works nicely for that sort of thing. I norma

Re: Scala considering significant indentation like Python

2017-05-24 Thread Grant Edwards
On 2017-05-23, Ben Finney wrote: > Grant Edwards writes: > >> On 2017-05-23, Michael Torrie wrote: >> > Sometimes things get longer than a page (like a class definition). >> >> A nice folding mode works nicely for that sort of thing. I normally >> use emacs, but it doesn't seem to have a folding

Emacs command to select only lines indented below a specified level (was: Scala considering significant indentation like Python)

2017-05-23 Thread Ben Finney
when you first learned Emacs, that all commands have a “prefix argument” available https://www.emacswiki.org/emacs/PrefixArgument> that the command can use to modify its behaviour. So, use the prefix argument to specify the number of columns for ‘set-selective-display’. E.g.: M-9 C-x $

Re: Scala considering significant indentation like Python

2017-05-23 Thread Fred Stluka
On 5/23/17 4:43 PM, Ben Finney wrote: The ‘set-selective-display’ command will collapse the current buffer's text to lines indented to the specified number of columns; the same command with no argument will expand the buffer to normal again. The command is bound to ‘C-x $’ in default Emacs. Ben

Re: Scala considering significant indentation like Python

2017-05-23 Thread Ben Finney
Grant Edwards writes: > On 2017-05-23, Michael Torrie wrote: > > Sometimes things get longer than a page (like a class definition). > > A nice folding mode works nicely for that sort of thing. I normally > use emacs, but it doesn't seem to have a folding mode built-in, and > the add-on one's I'v

Re: Scala considering significant indentation like Python

2017-05-23 Thread justin walters
eginning and end > of > >>> a blog? Wouldn't be too hard to just look at indent. > > > > Sigh. Missing words, the wrong words! Block, not blog. agg. > > > >> It's built-in, no plug-in necessary. > >> > >> I still find white-spa

Re: Scala considering significant indentation like Python

2017-05-23 Thread Grant Edwards
Sigh. Missing words, the wrong words! Block, not blog. agg. > >> It's built-in, no plug-in necessary. >> >> I still find white-space indentation easier to read, though. Is that > block 20 lines down inside or outside the above >> if/for/while? Just put your curs

Re: Scala considering significant indentation like Python

2017-05-22 Thread Mikhail V
> The creator of Scala, Martin Odersky, has proposed introducing Python-like > significant indentation to Scala and getting rid of braces: > > I was playing for a while now with ways to make Scala's syntax >indentation-based. I always admired the neatness of Python syntax

Re: Scala considering significant indentation like Python

2017-05-22 Thread Michael Torrie
x27;s built-in, no plug-in necessary. > > I still find white-space indentation easier to read, though. Is that block 20 lines down inside or outside the above > if/for/while? Just put your cursor on it and go straight down and you'll find out. Not so easy if the braces aren't

Re: Scala considering significant indentation like Python

2017-05-22 Thread Ethan Furman
ad of end end end end end, one combines the uninformative lines into one by writing end end end end end, and with four-space indentation the ends align neatly with the starts. Technically, the ends on the remaining line of ends are backwards. Kind of remin

  1   2   3   4   5   6   7   8   >