[melbourne-pug] foo is None bar is 2 so is foo < bar

2014-02-06 Thread Mike Dewhirst
It is in Python 2.7 ... Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> foo = None >>> bar = 2 >>> foo < bar True >>> But it seems not in Python 3.3 ... Python 3.3.3 (v3.3.3:c3896275c

Re: [melbourne-pug] foo is None bar is 2 so is foo < bar

2014-02-06 Thread Ben Finney
Mike Dewhirst writes: > But it seems not in Python 3.3 ... > > Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) [MSC v.1600 > 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> foo = None > >>> bar = 2 > >>> foo < bar > Traceback (most

Re: [melbourne-pug] foo is None bar is 2 so is foo < bar

2014-02-06 Thread Chris Maclachlan
Hi Mike None is not the same as int(0) - it's a bit like javascript's NaN (not-a-number); it's not 0, it's a complete absence of value; an indeterminate value. Because of this, it can't actually be successfully cast to a numeric: >>> a = None >>> int(a) Traceback (most recent call last): File "