Python's biggest compromises
mwilson at the-wire.com
Mon Aug 4 19:23:55 CEST 2003
In article <y3VWa.261$_p6.23775419 at newssvr21.news.prodigy.com>,
"Andy C" <ayc8NOSPAM at cornell.edu> wrote:
>What's bad about tabs? I'm new to Python. Tabs are good because then you
>can view the source however you want. I can't write in 4 space tabs and
>someone else can change it to 2 if they prefer. But I can see the problem
>with continuation lines. Also it must be ALL tabs or ALL spaces. This
>shouldn't be too hard -- most editors have the "tabify" option.
Nothing essentially. But if a program combines the two
forms, say somebody pastes space-using code into a tab-using
program, then strange things can happen for no obvious
reason. There's no standard exchange rate between tabs and
spaces in the Python syntax.
(Idea for obfuscated Python: a program that mixes spaces
and tabs in the indenting so as to perform two or more
distinct useful functions depending on the space-to-tab
rate. Bonus points for a program that undoes itself at
My own preference is for tabs, because my favourite
editor works well with them (i.e. Tab serves as indent and
Backspace as undent), and convert to spaces for people on
the outside, per convention.
More information about the Python-list