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


Groups > comp.lang.python > #74399 > unrolled thread

Re: Newbie: unexpected indenting error

Started byBen Finney <ben@benfinney.id.au>
First post2014-07-13 17:09 +1000
Last post2014-07-13 17:09 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#74399 — Re: Newbie: unexpected indenting error

FromBen Finney <ben@benfinney.id.au>
Date2014-07-13 17:09 +1000
SubjectRe: Newbie: unexpected indenting error
Message-ID<mailman.11786.1405235407.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web