471,073 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

pylint: don't warn about tabs

I am brand new to pylint.
As a tab user, I want the tabs warning turned off.
How?

Larger question:
where is the config file format documented?

Thanks,
Alan Isaac

PS This is a wonderful tool.
Mar 8 '07 #1
16 9368
Alan Isaac wrote:
I am brand new to pylint.
As a tab user, I want the tabs warning turned off.
How?
Advice: Don't. IIRC it's planned in future Python versions that TABs
aren't supported for indentation.

Regards,
Björn

--
BOFH excuse #401:

Sales staff sold a product we don't offer.

Mar 8 '07 #2
Bjoern Schliessmann <us**************************@spamgourmet.comwrite s:
Alan Isaac wrote:
As a tab user, I want the tabs warning turned off.

Advice: Don't.
Agreed. Sticking to spaces for indentation avoids the ambiguity of
interpretation that ASCII TAB characters are subject to. In addition,
PEP 8 (which many people consider a strong suggestion for a style
guide for all Python code) recommends four space characters for
indentation.
IIRC it's planned in future Python versions that TABs aren't
supported for indentation.
I've not seen such plans, can you support that?

If you're thinking of this post from Guido, please note the date it
was made:

<URL:http://www.artima.com/weblogs/viewpost.jsp?thread=101968>

--
\ "Dvorak users of the world flgkd!" -- Kirsten Chevalier, |
`\ rec.humor.oracle.d |
_o__) |
Ben Finney

Mar 8 '07 #3
Alan Isaac wrote:
I am brand new to pylint.
As a tab user, I want the tabs warning turned off.
How?

Larger question:
where is the config file format documented?
doc/features.txt
examples/pylintrc

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Mar 8 '07 #4
Ben Finney wrote:
Bjoern Schliessmann <us**************************@spamgourmet.com>
>IIRC it's planned in future Python versions that TABs aren't
supported for indentation.

I've not seen such plans, can you support that?
No ... 8)
If you're thinking of this post from Guido, please note the date
it was made:
Not this one; I thought that if there was a warning added about tabs
as whitespace recently, tabs will become forbidden in the future.

(That is not True, obviously ;) )

Anyway, thanks for correction.

Regards,
Björn

--
BOFH excuse #164:

root rot

Mar 8 '07 #5
En Thu, 08 Mar 2007 14:33:38 -0300, Bjoern Schliessmann
<us**************************@spamgourmet.comescri bió:
Alan Isaac wrote:
>As a tab user, I want the tabs warning turned off.

Advice: Don't. IIRC it's planned in future Python versions that TABs
aren't supported for indentation.
AFAIK, using tabs xor spaces will be ok, but not MIXING them.

--
Gabriel Genellina

Mar 8 '07 #6
Ben Finney wrote:
Bjoern Schliessmann <us**************************@spamgourmet.comwrite s:
>Alan Isaac wrote:
>>As a tab user, I want the tabs warning turned off.
Advice: Don't.

Agreed. Sticking to spaces for indentation avoids the ambiguity of
interpretation that ASCII TAB characters are subject to. In addition,
PEP 8 (which many people consider a strong suggestion for a style
guide for all Python code) recommends four space characters for
indentation.
For those who prefer say 3 or 8, pylint permits this to be specified in
the configuration file.

Colin W.
>
>IIRC it's planned in future Python versions that TABs aren't
supported for indentation.

I've not seen such plans, can you support that?

If you're thinking of this post from Guido, please note the date it
was made:

<URL:http://www.artima.com/weblogs/viewpost.jsp?thread=101968>
Mar 9 '07 #7
"Ben Finney" <bi****************@benfinney.id.auwrote in message
news:ma***************************************@pyt hon.org...
Sticking to spaces for indentation avoids the ambiguity of
interpretation that ASCII TAB characters are subject to.
What ambiguity?
Tabs are *less* ambiguous.
One tab character is one level of indentation.
I have never seen this violated.

Users of spaces cannot even count
on shared code being 4 rather than 8 spaces.

Even though tabs when on this score, face it,
in the end it is pure preference. There is no
"right" answer (even for emacs users). ;-)

And my actual question remains unanswered...

Alan Isaac
Mar 9 '07 #8
Alan Isaac wrote:
I am brand new to pylint.
As a tab user, I want the tabs warning turned off.
"Robert Kern" <ro*********@gmail.comwrote in message
news:ma***************************************@pyt hon.org...
doc/features.txt
examples/pylintrc
The example is very helpful.
Thanks!
Alan
Mar 9 '07 #9

Alan"Ben Finney" <bi****************@benfinney.id.auwrote in message
Alannews:ma*************************************** @python.org...
>Sticking to spaces for indentation avoids the ambiguity of
interpretation that ASCII TAB characters are subject to.
AlanWhat ambiguity?
AlanTabs are *less* ambiguous.
AlanOne tab character is one level of indentation.
AlanI have never seen this violated.

The ambiguity comes when eventually your source is edited by someone else.
Perhaps you have the discipline to use only spaces or only tabs, but the guy
in the next cubicle is as likely to use spaces as you are to use tabs. Once
he edits a file the two of you share, you're toast.

This is not a new topic. After a lot of discussion over the years the
general consensus in the Python community is that spaces are the only way to
go. Here are some references:

http://www.python.org/dev/peps/pep-0666/
http://mail.python.org/pipermail/pyt...ry/183758.html
http://wiki.w4py.org/spaces-not-tabs.html

The Python distribution even comes with two scripts, tabnanny and reindent,
which were developed to detect and eliminate the ambiguity caused by mixing
spaces and tabs. The beginning of the reindent doc string reads:

Change Python (.py) files to use 4-space indents and no hard tab
characters. Also trim excess spaces and tabs from ends of lines, and
remove empty lines at the end of files. Also ensure the last line ends
with a newline.

If only tabs were considered to be a viable alternative to only spaces,
reindent would almost certainly have grown a flag by now to allow that.

The tag line for tabnanny reads:

The Tab Nanny despises ambiguous indentation. She knows no mercy.

Finally, note this from PEP 666:

The problem is that there is no polite way to say 'Stop wasting your
valuable time and mine.'

That's as politely as I can put it.

Skip
Mar 10 '07 #10
On Fri, 9 Mar 2007, sk**@pobox.com apparently wrote:
Finally, note this from PEP 666:
The problem is that there is no polite way to say
'Stop wasting your valuable time and mine.'
That's as politely as I can put it.


I really think you should reread the PEP, which is making

the opposite of your point.

Cheers,

Alan
Mar 10 '07 #11
Alan Isaac wrote:
What ambiguity?
Tabs are *less* ambiguous.
One tab character is one level of indentation.

I have never seen this violated.
Not quite a proof ...
Users of spaces cannot even count
on shared code being 4 rather than 8 spaces.
You also can't count on proper TAB code.
Even though tabs when on this score, face it,
in the end it is pure preference. There is no
"right" answer (even for emacs users). ;-)
ACK.
And my actual question remains unanswered...
(--indent-string or changing a config file doesn't work for you? I
have the impression it was answered.)

Regards,
Björn

--
BOFH excuse #364:

Sand fleas eating the Internet cables

Mar 10 '07 #12
>Finally, note this from PEP 666:

AlanI really think you should reread the PEP, which is making
Alanthe opposite of your point.

Quite the opposite, in fact. Laura Creighton wrote that PEP precisely with
the expectation (and hope) that Guido would reject it, which he did:

PEP: 666
Title: Reject Foolish Indentation
Version: 1083
Last-Modified: 2001-12-12 00:40:09 +0100 (Wed, 12 Dec 2001)
Author: Laura Creighton <lac at strakt.com>
Status: Rejected
Type: Standards Track
Created: 3-Dec-2001
Python-Version: 2.2
Post-History: 5-Dec-2001

Note the title and status.

Skip
Mar 10 '07 #13
Gabriel Genellina wrote:
En Thu, 08 Mar 2007 14:33:38 -0300, Bjoern Schliessmann
<us**************************@spamgourmet.comescri bió:
>Alan Isaac wrote:
>>As a tab user, I want the tabs warning turned off.


Advice: Don't. IIRC it's planned in future Python versions that TABs
aren't supported for indentation.


AFAIK, using tabs xor spaces will be ok, but not MIXING them.
That's what should be enforced. For any module, whitespace
at the beginnings of lines should be all spaces or all tabs.
Both are unambiguous and can be mechanically converted to each
other. But if spaces and tabs are mixed, there's ambiguity.

John Nagle
Mar 10 '07 #14
sk**@pobox.com wrote:
http://www.python.org/dev/peps/pep-0666/
In pep-0666, Laura Creighton wrote:
People who mix tabs and spaces, naturally, will find that their
programs do not run. Alas, we haven't found a way to give them an
electric shock as from a cattle prod remotely. (Though if somebody
finds out a way to do this, I will be pleased to add this option to
the PEP.)
Fortunately, since the PEP was last edited in 2001, there has been progress
on this front with the advent of the Microsoft WE-SYP programme. (see
http://www.youtube.com/watch?v=M-c0YSsF_O0 ). We should find out whether
the technology can be licensed for use in a future release of Python.
Mar 10 '07 #15
Alan:
>I really think you should reread the PEP, which is making
the opposite of your point.
Skip:
Quite the opposite, in fact. Laura Creighton wrote that
PEP precisely with the expectation (and hope) that Guido
would reject it, which he did: Note the title and status.
Sorry Skip, but this is really just a matter of taking off
your blinkers and learning to read. As you say, note the
title and status. Or alternatively, read this from the PEP:

I figure if I make this PEP, we can then ask Guido
to quickly reject it, and then when this argument
next starts up again, we can say 'Guido isn't
changing things to suit the tab-haters or the
only-tabbers, so this conversation is a waste of
time.'

Alan Isaac

Mar 10 '07 #16
Alan:
>my actual question remains unanswered...
Bjoern:
--indent-string or changing a config file doesn't work for you?
Works great. (I read Robert's message subsequent to that
complaint.) And pylint is wonderful.

Alan Isaac
Mar 10 '07 #17

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Michael Yanowitz | last post: by
5 posts views Thread by Tuomas | last post: by
7 posts views Thread by montyphyton | last post: by
2 posts views Thread by lgfang | last post: by
2 posts views Thread by Mick Charles Beaver | last post: by
reply views Thread by KLEIN Stephane | last post: by
2 posts views Thread by dmitrey | last post: by
1 post views Thread by Diez B. Roggisch | last post: by
2 posts views Thread by GHUM | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.