Python Forum
IndentationError message could be confusing to new programmers
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IndentationError message could be confusing to new programmers
#1
Not sure if this is the best subforum in which to post this. Please correct me if necessary.

The Python docs distinguish between a suite in control statements and a block in functions or classes. However, when you get an IndentationError in a suite, Python displays, "IndentationError: expected an indented block."

This could be confusing to someone new to Python. I am wondering if this error message can be tweaked so that it displays block or suite based on the context.
Reply
#2
This should be directed to python.org (which is not us)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Deitel book "Python for Programmers" ricardian 7 19,964 May-12-2023, 01:33 PM
Last Post: snippsat
  IndentationError: unexpected indent dee 3 2,229 May-02-2022, 02:15 AM
Last Post: dee
  Confusing in [for loop] topic Sherine 11 3,382 Jul-31-2021, 02:53 PM
Last Post: deanhystad
  error "IndentationError: expected an indented block" axa 4 2,859 Sep-08-2020, 02:09 PM
Last Post: ibreeden
  IndentationError: unexpected indent jk91 1 2,339 Feb-27-2020, 08:56 PM
Last Post: buran
  Confusing logic Blob 4 2,346 Nov-18-2019, 03:26 AM
Last Post: Blob
  IndentationError jagannath 1 2,437 Nov-04-2019, 07:41 AM
Last Post: buran
  IndentationError: expected an indented block ryder5227 2 2,562 Sep-27-2019, 06:59 PM
Last Post: jefsummers
  IndentationError on installed package evvvonder 3 2,972 Jun-29-2019, 10:30 PM
Last Post: Gribouillis
  how do i fix this problem - IndentationError? GrandMaster101 8 7,590 Apr-04-2019, 09:38 PM
Last Post: carloszoom3000

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020