Hans Georg Schaathun wrote:
On 11 May 2011 13:36:02 GMT, Steven D'Aprano
  <steve+comp.lang.pyt...@pearwood.info> wrote:
: > In this case, the interpretation of an arbitrary object as a boolean is
: > peculiar for python. : : Incorrect. It is widespread among many languages. Programmers have been : writing conditional tests using arbitrary values since 1958 when Lisp : introduced the concept.

The fact that you need to list language by language which objects
evaluate as false or equivalent to false illustrates that this has
to be learnt language by language.  Allowing arbitrary objects is
one thing, the particular interpretation is peculiar.


Like so many other things Python got right, I think it got this right as well. "something" vs "nothing" is simple, useful, and easy to remember.


By now we have gotten past that old-fashioned idea that 0
is not a number.  Computer scientists even tend to count 0 as a
natural number.  When 0 is a number as real and existent as any other,
one would think that the empty list is also as real and existent as
any other list.

Python is not concerned with whether it exists -- that's a name binding; Python is concerned with whether anything is there. 0 apples is nothing and a an empty list is nothing as well.

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

Reply via email to