Re: Null object pattern

2008-11-12 Thread Robin Becker

Ben Finney wrote:

Terry Reedy <[EMAIL PROTECTED]> writes:


We're not going to add the "feature" back that None compares smaller
than everything. It's a slippery slope that ends with all operations
involving None returning None -- I've seen a proposal made in all
earnestness requesting that None+42 == None, None() == None, and so
on. This Nonesense was wisely rejected


I agree with that decision. However, the behaviour you specify *is*
useful (though I don't think ‘None’ should have that behaviour). It is
the “Null object” design pattern, and may be familiar to many
readers in its SQL implementation as the ‘NULL’ non-value.

In fact, there is a Python Cookbook recipe implementing a ‘Null’
object http://code.activestate.com/recipes/68205/> that also
features in the O'Reilly _Python Cookbook, second edition_.

the difficulty here is that everybody will implement different Null 
objects and lead to unwanted fragmentation.

--
Robin Becker
--
http://mail.python.org/mailman/listinfo/python-list


Re: Null object pattern

2008-11-11 Thread Terry Reedy

Ben Finney wrote:

Terry Reedy <[EMAIL PROTECTED]> writes:


We're not going to add the "feature" back that None compares smaller
than everything. It's a slippery slope that ends with all operations
involving None returning None -- I've seen a proposal made in all
earnestness requesting that None+42 == None, None() == None, and so
on. This Nonesense was wisely rejected


I agree with that decision. However, the behaviour you specify *is*


For the record, I was quoting Guido there.

--
http://mail.python.org/mailman/listinfo/python-list