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.

classification
Title: multiple comparison
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Chandan, SilentGhost, xtreak
Priority: normal Keywords:

Created on 2019-07-01 08:19 by Chandan, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg346972 - (view) Author: Chandan Kumar (Chandan) Date: 2019-07-01 08:19
a=1.0
b=0.0
c=0.0
if (a> d and b):
     print('hi')
else:
     print("bye")

its going to else part
a=1.0
b=0.1
c=0.2
then its going to if part
a==1.0
b=0
c=0.1
then again its going to else part
msg346977 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-07-01 08:40
a=1.0
b=0.0
c=0.0
if (a> d and b):
     print('hi')
else:
     print("bye")

d is not defined here and it throws a NameError for me. Can you please attach the full scripts that can be used to reproduce the behavior in the report.
msg346978 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2019-07-01 08:48
Your issue seems to be related to evaluation of 0.0 as falsy value. See documentation at https://docs.python.org/3/library/stdtypes.html#truth-value-testing
History
Date User Action Args
2022-04-11 14:59:17adminsetgithub: 81645
2019-07-01 08:48:49SilentGhostsetstatus: open -> closed
nosy: + SilentGhost, - docs@python
messages: + msg346978

assignee: docs@python ->
resolution: not a bug
stage: resolved
2019-07-01 08:40:20xtreaksetnosy: + xtreak
messages: + msg346977
2019-07-01 08:21:01Chandansettype: enhancement -> behavior
2019-07-01 08:19:39Chandancreate