Mark Dickinson added the comment:

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'.

----------
nosy: +mark.dickinson

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20855>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to