Bugs item #1695688, was opened at 2007-04-06 15:28 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1695688&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: [EMAIL PROTECTED] (bacademy) Assigned to: Nobody/Anonymous (nobody) Summary: Unexpected feature vs. integer and True values Initial Comment: Integer 1 interpreted as True. I didn't expect the following: Python 2.5 (r25:51908, Apr 4 2007, 10:19:35) [GCC 4.1.1 20060724 (prerelease) (4.1.1-3mdk)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> v = 2 >>> 0.0 if v == True else float(v) 2.0 >>> v = 1 >>> 0.0 if v == True else float(v) 0.0 I know how to fix this, by writing 0.0 if v is True else float(v) but to casual observer it is not obvious... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1695688&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com