checking if a list is empty

Hans Georg Schaathun hg at schaathun.net
Wed May 11 15:13:35 EDT 2011


On Wed, 11 May 2011 12:17:33 -0700, Ethan Furman
  <ethan at stoneleaf.us> wrote:
:  'if li' *is* KISS.

It /might/ be in some contexts, but a priori it is not, as it
superimposes a truth value on a data type which is otherwise
a pretty accurate model of real objects (outside python).

One principle of object oriented programming is to bestow the
objects with properties reflecting known properties from the
domain being modelled.  Lists do not have truth values in the
application domain, and therefore truth values in the
implementation domain is complicated.

-- 
:-- Hans Georg



More information about the Python-list mailing list