Author mark.dickinson
Recipients dstufft, mark.dickinson, ncoghlan, tim.peters, yselivanov
Date 2014-03-06.08:39:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I realise this was opened as a joke, but I actually consider this suggestion to be unridiculous.  I've never felt comfortable with code that does  "if x" rather than "if x != 0.0"  for x a float.

What really makes this a no-go in Python is the equality between floats and ints, and then between ints and bools.  If we want to maintain the invariant that  x == y implies  bool(x) == bool(y)  then we end up making bool(0) and bool(False) true, the latter of which is clearly ridiculous.

So not in Python, but perhaps in some other Python-like language with a notion of 'boolean context'.
Date User Action Args
2014-03-06 08:39:21mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, ncoghlan, yselivanov, dstufft
2014-03-06 08:39:20mark.dickinsonsetmessageid: <>
2014-03-06 08:39:20mark.dickinsonlinkissue20855 messages
2014-03-06 08:39:19mark.dickinsoncreate