This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sangeetamchauhan
Recipients sangeetamchauhan, tim.peters
Date 2019-09-09.04:28:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAEO0aX8WO0oVEk_=WUHZ+=ibFTESn-wS4tQmrDdbuUkh6e-Wqw@mail.gmail.com>
In-reply-to <1568001313.18.0.812181700112.issue38060@roundup.psfhosted.org>
Content
i am not satisfied ..with your answer . as in the following expression   9
or 7 > "str" precedence must be given to relational operator . why is is
executing logical operator first??????????????
if we write  4>9 or 7> "str" it works correct but if we replace first
condition(4>9) with a numeric value it is not giving correct output

On Mon, Sep 9, 2019 at 9:25 AM Tim Peters <report@bugs.python.org> wrote:

>
> Tim Peters <tim@python.org> added the comment:
>
> It's working fine.  What do you expect?  For example,
>
>     9 or 7 > "str"
>
> groups as
>
>     9 or (7 > "str")
>
> 9 is evaluated for "truthiness" first, and since it's not 0 it's
> considered to be true.  That's enough to determine the result of "or", so
> (7 > "str") isn't evaluated at all.  9 is the result.
>
> This is all working as designed and as documented, so I'm closing this
> report.
>
> ----------
> nosy: +tim.peters
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue38060>
> _______________________________________
>
History
Date User Action Args
2019-09-09 04:28:53sangeetamchauhansetrecipients: + sangeetamchauhan, tim.peters
2019-09-09 04:28:53sangeetamchauhanlinkissue38060 messages
2019-09-09 04:28:53sangeetamchauhancreate