Why not enforce four space indentations in version 3.x?

Ben Finney ben+python at benfinney.id.au
Thu Jul 16 19:56:33 EDT 2009

Inky 788 <inky788 at gmail.com> writes:

> On Jul 10, 7:35 pm, Ben Finney <ben+pyt... at benfinney.id.au> wrote:
> > Yes. That's a “should” and not a “must”, even though PEP 8 says it
> > with a simple imperative::
> >
> >     Use 4 spaces per indentation level.
> That actually sounds pretty weird. "Don't do {foo}. Really, I mean
> *really* don't do {foo}. Oh, also, the interpreter allows you to do
> {foo}. But don't do it! I mean it!".

Not weird at all, especially when you realise that your interpretation
isn't there in the document.

The allowance for both types of indentation is a compromise made for
backward compatibility with code written before this convention was
quite so strong. All *new* code is strongly advised to follow the
convention, while the interpreter will still allow old code that doesn't
follow the convention.

> Very ... perlish, if you ask me.

Hah! Perl doesn't have the “don't do {foo}” part, so I don't see what
you're seeing.

 \      “I like to skate on the other side of the ice.” —Steven Wright |
  `\                                                                   |
_o__)                                                                  |
Ben Finney

More information about the Python-list mailing list