Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 841935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:52:47+00:00 2026-05-15T05:52:47+00:00

Whitespace is signification in Python in that code blocks are defined by their indentation.

  • 0

Whitespace is signification in Python in that code blocks are defined by their indentation.

Furthermore, Guido van Rossum recommends using four spaces per indentation level (see PEP 8: Style Guide for Python Code).

What was the reasoning behind not requiring exactly four spaces per indentation level as well? Are there any technical reasons?

It seems like all the arguments that can be made for making whitespace define code blocks can also be used to argument for setting an exact whitespace length for one indentation level (say four spaces).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:52:47+00:00Added an answer on May 15, 2026 at 5:52 am

    There are no technical reasons. It would not be too hard to modify the Python interpreter to require exactly four spaces per indentation level.

    Here is one use case for other indentation levels: when typing into the interactive interpreter, it’s very handy to use one-space indentations. It saves on typing, it’s easier to count the number of spaces correctly, and readability is not a major concern (since the code isn’t even saved in a file).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does [_\s^] mean underscore and whitespace but not (quote) in Reg I understand that
Possible Duplicate: Substitute multiple whitespace with single whitespace in Python trying to figure out
This code trims whitespace, (fyi: it's credited to be very fast) function wSpaceTrim(s){ var
I have a test form with whitespace above the top image that shouldn't be
How i can delete whitespace in each line of file, using bash For instance,
Python's string.whitespace is great: >>> string.whitespace '\t\n\x0b\x0c\r ' How do I use this with
I want to remove all whitespace characters from a multi-line string using regex. What
I know that trim removes whitespace from the beginning and end of a string,
I'm trying to trim JSP whitespace using the trimSpaces directive in my web.xml, but
I want to find and replace all whitespace that is shown below between $

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.