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


Groups > comp.lang.python > #46359

Re: IndentationError: expected an indented block but it's there

References <V54pt.161708$Zp1.55817@en-nntp-15.dc1.easynews.com> <ko2let$73u$1@ger.gmane.org> <CAPTjJmod5Yus_bOfONBysO=P3Wq4AUskKY0wMyP4NgHR6xE6zw@mail.gmail.com> <ko2ndo$105$1@ger.gmane.org>
Date 2013-05-29 17:59 +1000
Subject Re: IndentationError: expected an indented block but it's there
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2344.1369814374.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, May 29, 2013 at 2:53 AM, Peter Otten <__peter__@web.de> wrote:
> Chris Angelico wrote:
>
>> On Wed, May 29, 2013 at 2:19 AM, Peter Otten <__peter__@web.de> wrote:
>>> Solution: configure your editor to use four spaces for indentation.
>>
>> ITYM eight spaces.
>
> I meant: one hit of the Tab key should add spaces up to the next multiple of
> four. Which implies
>
>> But the real solution is to not mix tabs and
>> spaces. Stick to one or the other and you're safe.

Sure. If you configure your tab *key* to not insert a tab *character*,
then you're fine. Or alternatively, if you always use \t for
indentation, you can tweak the displayed width of it. (Or, as I do,
just let it be eight wide. On today's screens that's not much of a
problem.)

ChrisA

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


Thread

IndentationError: expected an indented block but it's there JackM <notreal@earthlink.net> - 2013-05-28 11:32 -0400
  Re: IndentationError: expected an indented block but it's there Michael Torrie <torriem@gmail.com> - 2013-05-28 09:55 -0600
  Re: IndentationError: expected an indented block but it's there Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-28 16:01 +0000
  Re: IndentationError: expected an indented block but it's there Peter Otten <__peter__@web.de> - 2013-05-28 18:19 +0200
  Re: IndentationError: expected an indented block but it's there Chris Angelico <rosuav@gmail.com> - 2013-05-29 02:31 +1000
  Re: IndentationError: expected an indented block but it's there Peter Otten <__peter__@web.de> - 2013-05-28 18:53 +0200
  Re: IndentationError: expected an indented block but it's there Chris Angelico <rosuav@gmail.com> - 2013-05-29 17:59 +1000

csiph-web