osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python indentation (3 spaces)


On 2018-10-14 00:45:49 +0000, Grant Edwards wrote:
> On 2018-10-13, Peter J. Holzer <hjp-python at hjp.at> 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 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 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 you are typing, they won't
even know how wide your tabs are.

(That said, I personally prefer shorter indentation for marked up text
(like HTML or LaTeX) than for programming languages. But I could live
with the same indentation if necessary (and of course it isn't
necessary: Any decent editor has to be able detect the file type anyway
for syntax highlighting so it can adjust the display of tabs, too.))

        hp

-- 
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp at hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20181014/ce4c086c/attachment.sig>