Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74399

Re: Newbie: unexpected indenting error

From Ben Finney <ben@benfinney.id.au>
Subject Re: Newbie: unexpected indenting error
Date 2014-07-13 17:09 +1000
References <CAHXoDSDuKsqJ7ceXoUXA3g5K9J0UNRJ7g29uJMPxZEqHQCaCnA@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.11786.1405235407.18130.python-list@python.org> (permalink)

Show all headers | View raw


Martin S <shieldfire@gmail.com> writes:

> What the...? What am I doing wrong?
> (hopefully the indents translate; else def, if/elif, for and [dostuff]
> are indented)

They're all indented by different amounts. I don't see anything that
would cause the parser to tell you “unexpected indent”, though.

For those reasons together, I suspect what you've posted here does not
match exactly what is in your Python code.

My recommendation:

* Instruct your text editor to highlight any U+0009 characters
  (horizontal tab) as an error, and remove them. Indent with U+0020
  SPACE characters only; PEP 8 recommends four spaces per indent level.

* Ensure your emails are composed in plain text (AFAICT, you're already
  doing this), and show us *exactly* a complete example of code that
  will demonstrate the behaviour you're seeing. Make a new one, if you
  need to; just make sure it's complete so you can expect others to be
  able to run it too.

-- 
 \      “If I haven't seen as far as others, it is because giants were |
  `\                           standing on my shoulders.” —Hal Abelson |
_o__)                                                                  |
Ben Finney

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Newbie: unexpected indenting error Ben Finney <ben@benfinney.id.au> - 2014-07-13 17:09 +1000

csiph-web