Re: Why is None <= 0

2008-05-03 Thread Michael Mabin
New style classes are classes inherited from class object. Therefore: class A: pass is oldstyle, while class B(object): pass is newstyle. On Tue, Apr 29, 2008 at 8:29 AM, blaine <[EMAIL PROTECTED]> wrote: > On Apr 29, 5:32 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > > =?ISO-8859-15?

Re: Why is None <= 0

2008-05-02 Thread Terry Reedy
"Aaron Watters" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |What's up with Tim Peters anyway? I haven't seen much from him for a while. I miss him too ;-) He occasionally responds to tracker or pydev math issues where his unique knowledge and experience is really needed. (As

Re: Why is None <= 0

2008-05-02 Thread Aaron Watters
On Apr 25, 8:17 pm, Jon Ribbens <[EMAIL PROTECTED]> wrote: > On 2008-04-25, Martin v. Löwis <[EMAIL PROTECTED]> wrote: > > > None is smaller than anything. > > According to Tim Peters, this is not true. > > See http://bugs.python.org/issue1673405 This is unfortunate. I would advocate something li

Re: Why is None <= 0

2008-04-29 Thread Duncan Booth
blaine <[EMAIL PROTECTED]> wrote: > On Apr 29, 5:32 am, Duncan Booth <[EMAIL PROTECTED]> wrote: >> =?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> >> wrote: >> > (FWIW, in 2.x, x>=4?, it's None < numbers < anything else; >> > numbers are ordered by value, everything else is ordere

Re: Why is None <= 0

2008-04-29 Thread blaine
On Apr 29, 5:32 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > =?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: > > (FWIW, in 2.x, x>=4?, it's None < numbers < anything else; > > numbers are ordered by value, everything else is ordered > > by type name, then by address, unless

Re: Why is None <= 0

2008-04-29 Thread Duncan Booth
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: > (FWIW, in 2.x, x>=4?, it's None < numbers < anything else; > numbers are ordered by value, everything else is ordered > by type name, then by address, unless comparison functions > are implemented). Quite apart from Jon poin

Re: Why is None <= 0

2008-04-25 Thread John Nagle
Gregor Horvath wrote: D'Arcy J.M. Cain schrieb: On Fri, 25 Apr 2008 20:27:15 +0200 Gregor Horvath <[EMAIL PROTECTED]> wrote: >>> None <= 0 True Why? Why not? Because, from http://www.python.org/dev/peps/pep-0020/ : Errors should never pass silently. In the face of ambiguity, refuse the t

Re: Why is None <= 0

2008-04-25 Thread Ben Finney
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2008-04-25, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > > On Fri, 25 Apr 2008 20:27:15 +0200 > > Gregor Horvath <[EMAIL PROTECTED]> wrote: > >> >>> None <= 0 > >> True > > Everything in Python can compare to everything else. > > Not true. Even mo

Re: Why is None <= 0

2008-04-25 Thread Grant Edwards
On 2008-04-25, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > On Fri, 25 Apr 2008 20:27:15 +0200 > Gregor Horvath <[EMAIL PROTECTED]> wrote: >> >>> None <= 0 >> True >> >> Why? > > Why not? > >> Is there a logical reason? > > Everything in Python can compare to everything else. Not true. Pytho

Re: Why is None <= 0

2008-04-25 Thread Jon Ribbens
On 2008-04-25, Martin v. Löwis <[EMAIL PROTECTED]> wrote: > None is smaller than anything. According to Tim Peters, this is not true. See http://bugs.python.org/issue1673405 -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is None <= 0

2008-04-25 Thread Christian Heimes
> In my humble opinion, I think that comparisons involving None should > return None, but I trust that the designers came up with this for very > good reasons. As far as I know I've never been bitten by it. It's fixed in Python 3.x. Python 3.x refuses to compare objects unless one of both objects

Re: Why is None <= 0

2008-04-25 Thread Gary Herron
Gregor Horvath wrote: Hi, >>> None <= 0 True Why? Is there a logical reason? Gregor -- http://mail.python.org/mailman/listinfo/python-list In early Python, the decision was made that the comparison of *any* two objects was legal and would return a consistent result. So objects of differen

Re: Why is None <= 0

2008-04-25 Thread Grant Edwards
On 2008-04-25, Gregor Horvath <[EMAIL PROTECTED]> wrote: > Hi, > > >>> None <= 0 > True > > Why? Comparing objects of differing types produces an undefined result. Next time you do it, it might return False. (Well, it's not really going to, but it's allowed to.) > Is there a logical reason? For

Re: Why is None <= 0

2008-04-25 Thread D'Arcy J.M. Cain
On Fri, 25 Apr 2008 11:54:23 -0700 Paul McNett <[EMAIL PROTECTED]> wrote: > In my humble opinion, I think that comparisons involving None should > return None... Like relational databases. -- D'Arcy J.M. Cain <[EMAIL PROTECTED]> | Democracy is three wolves http://www.druid.net/darcy/

Re: Why is None <= 0

2008-04-25 Thread Gregor Horvath
D'Arcy J.M. Cain schrieb: On Fri, 25 Apr 2008 20:27:15 +0200 Gregor Horvath <[EMAIL PROTECTED]> wrote: >>> None <= 0 True Why? Why not? Because, from http://www.python.org/dev/peps/pep-0020/ : Errors should never pass silently. In the face of ambiguity, refuse the temptation to guess. Gr

Re: Why is None <= 0

2008-04-25 Thread Paul McNett
Gregor Horvath wrote: >>> None <= 0 True More accurately: None < 0 True Why? Is there a logical reason? None is "less than" everything except for itself: >>> None < 'a' True >>> None < False True >>> None == None True In my humble opinion, I think that comparisons involving None shoul

Re: Why is None <= 0

2008-04-25 Thread D'Arcy J.M. Cain
On Fri, 25 Apr 2008 20:27:15 +0200 Gregor Horvath <[EMAIL PROTECTED]> wrote: > >>> None <= 0 > True > > Why? Why not? > Is there a logical reason? Everything in Python can compare to everything else. It is up to the programmer to make sure that they are comparing reasonable things. -- D'Arc

Re: Why is None <= 0

2008-04-25 Thread Martin v. Löwis
None <= 0 > True > > Why? > Is there a logical reason? None is smaller than anything. The choice of making it so is arbitrary, however, Python 2.x tries to impose a total order on all objects (with varying success), therefore, it is necessary to take arbitrary choices. (FWIW, in 2.x, x>=4?

Why is None <= 0

2008-04-25 Thread Gregor Horvath
Hi, >>> None <= 0 True Why? Is there a logical reason? Gregor -- http://mail.python.org/mailman/listinfo/python-list