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

  • SEARCH
  • Home
  • 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 6221333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:06:52+00:00 2026-05-24T08:06:52+00:00

Is there a reason why this doesn’t work in Python? if 1 != 1

  • 0

Is there a reason why this doesn’t work in Python?

if 1 != 1 or
   2 != 2:
   print 'Something is wrong...'
  • 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-24T08:06:53+00:00Added an answer on May 24, 2026 at 8:06 am

    Perhaps this prevents a grammar ambiguity, but I feel that this behaviour is in the spirit of PEP 20, specifically ‘Simple is better than complex’ (among others). In other words, ‘Unless you have a good reason, why should expressions span multiple lines?’. If you have a good reason, the syntax devices to get around this are provided.

    [edit]
    I did some more reading, and there are a few references of interest:

    • The lexical definition of statements says that logical lines end in with a newline. Each case for adding an implicit continuation becomes and exceptional case.
    • PEP 3125 for Python 3, proposed removing slash (\) continuation, but was rejected due to lack of support.
      • Discussion in the mailing list reminds us that parenthetical continuation occurs because newlines do not end statements while parenthesis remain unbalanced.
      • In that same thread, Guido opposes the change because errors like the following are disguised:

        x = y+    # Used to be y+1, the 1 got dropped
        f(x)
    

    My final point is, the slash acts (or open parens) acts as a reminder that the statement is continued on the next line. Depending on your indentation, it’s possible that the continuation could be mistaken for a separate statement (which I think this other response touches on).

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

Sidebar

Related Questions

===EDIT=== Is there a reason something like this doesn't work i feel like it
Is there a reason why this query doesn't work? The following query will work
Is there any reason something like this would not work? This is the logic
Is there a reason why this CSS doesn't work? http://jsfiddle.net/6v5BZ/ a[href^=http]:after { content:; width:10px;
Is there any reason why this shouldn't work? [PseudoCode] main() { for (int i
I have a seeds.rb file and for some reason, this doesn't work: #doesn't work
Is there a good reason for this? It is a lame question, but I
Is there any reason why XML such as this : <person> <firstname>Joe</firstname> <lastname>Plumber</lastname> </person>
For some reason I never see this done. Is there a reason why not?
Is there any reason to do use block initialization, like this: x = Observer.new

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.