Non-Indented python

Tim Peters tim at zope.com
Thu Nov 29 16:24:40 EST 2001


[Tim]
> Nope.  The "nanny" in "tabnanny" is there for a reason:
> grownups have no problems here.

[Chris Barker]
> I don't think that's true.

You could knock me over with a tab <wink>.

> I often start working on a file I got from elsewhere with tabs in it,

So convert it -- that's what "grownups" do.

> get some wierd error, eventually think to check for tabs.

Don't you run Python with -tt?

> Then I run a script on it, clean it up, and all is well.
> This would be a WHOLE LOT easier if I got a "syntax error: mixed tabs
> and spaces" the first time I ran it. And what would we lose???

I'd lose a lot of time replying to complaints about the new errors -- as far
as Python is concerned, tab characters are 8-space gimmicks, and there's
nothing wrong with Python source mixing tabs and spaces under that
assumption.  While it's anti-social to *distribute* code in that state,
Python doesn't care to outlaw private vice.

> There are a lot of issue swith backward compatabilty, but this is one
> cse where you could run a simple script over any previously valid code
> and get valid code back. No problem there.

You can already do that.

>>> Personally, I would prefer that future versions of Python would allow
>>> ONLY tabs or ONLY spaces, but clearly there would be a major
>>> disagreement about which to use.

>> It would be spaces -- "4-space indents, no hard tab characters
>> anywhere" is the coding standard for the Python library.

> I imagine Huaiyu, if no one else, would take issue with this.

It would be spaces regardless.  If you've been reading this thread at all
(or any of its 500 isomorphic predecessors), you should have picked up that
somebody will take heated issue with any approach whatsoever -- including
the status quo.  So what?  The core developers reached consensus that
4-space etc works best across platforms.  We're not going to force anyone
else to do that (unless they want to get a module into the core
distribution), but the issue is long dead to Guido & company.

not-accusing-guido-of-being-a-grownup-ly y'rs  - tim





More information about the Python-list mailing list