Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5289

Re: checking if a list is empty

From rusi <rustompmody@gmail.com>
Newsgroups comp.lang.python
Subject Re: checking if a list is empty
Date 2011-05-13 03:58 -0700
Organization http://groups.google.com
Message-ID <4ebe45e2-9f6c-4f2c-b641-647490a75888@y27g2000prb.googlegroups.com> (permalink)
References (5 earlier) <931adaF9g1U1@mid.individual.net> <roy-FC7816.07362712052011@news.panix.com> <4dcc785e$0$29980$c3e8da3$5496439d@news.astraweb.com> <d423a455-f14e-4cb4-8744-0a49259c9c86@34g2000pru.googlegroups.com> <mailman.1509.1305273735.9059.python-list@python.org>

Show all headers | View raw


On May 13, 1:02 pm, Chris Rebert <c...@rebertia.com> wrote:
> On Thu, May 12, 2011 at 11:46 PM, rusi <rustompm...@gmail.com> wrote:
>
> > The boolean domain is only a 100 years old.
> > Unsurprisingly it is not quite 'first-class' yet: See
>
> It is nowadays. Every halfway-mainstream language I can think of has
> an explicit boolean datatype.

I guess you did not quite see my 'quite' -- which itself is a
summarization of Dijkstra's "officially" vs "in practice" ? [Heres the
quote]


> >http://www.cs.utexas.edu/users/EWD/transcriptions/EWD10xx/EWD1070.html
> > [Lifted fromhttp://c2.com/cgi/wiki?EqualVsTrueFalse]
>
> > ----------------------------
> > "In retrospect, one might be tempted to regard the introduction of
> > something as simple as the boolean domain as a minor invention, but I
> > think that that would be a grave mistake: it is a great invention
> > because, being so simple, it is such a powerful simplifier. It is of
> > the same level as the introduction of natural numbers, which enabled
> > us to add 3 to 5, regardless of whether we are adding apples or
> > pears."
>
> > "George Boole made a radical invention, so radical, in fact, that now,
> > more than a century later, the scientific community has not absorbed
> > it yet. (To stay with the metaphor: officially, boolean expressions
> > may have reached the status of first-class citizens, in practice —
> > because old habits and prejudices die hard— they are still the victims
> > of discrimination.) Let me give you a few examples."
>
> > "In the programming language FORTRAN, as conceived a century after
> > Boole published his invention, boolean expressions are allowed, but
> > there are no boolean variables! Their introduction into programming
> > had to wait until the design of ALGOL 60."


As an analogy, in Perl, a list can get coerced to its length "... when
in scalar context.." or something like that.  Most programmers from
the static-typechecked-languages camp would balk at that laissez faire
attitude.  Likewise Harris is pointing out that noob python
programmers may feel a bit unnerved by non-boolean types unexpectedly
showing 'boolean-ness.'  Maybe we are just more in noob category and
we've not got the zen of python?? Dunno...

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

checking if a list is empty Jabba Laci <jabba.laci@gmail.com> - 2011-05-06 02:36 -0400
  Re: checking if a list is empty Richard Thomas <chardster@gmail.com> - 2011-05-06 03:34 -0700
  Re: checking if a list is empty scattered <tooscattered@gmail.com> - 2011-05-06 14:57 -0700
    Re: checking if a list is empty Philip Semanchuk <philip@semanchuk.com> - 2011-05-06 18:21 -0400
    Re: checking if a list is empty Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-06 17:51 -0600
      Re: checking if a list is empty Jon Clements <joncle@googlemail.com> - 2011-05-06 17:43 -0700
        Re: checking if a list is empty Hans Mulder <hansmu@xs4all.nl> - 2011-05-14 10:52 +0200
    Re: checking if a list is empty Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-07 02:51 +0000
      Re: checking if a list is empty Hans Georg Schaathun <hg@schaathun.net> - 2011-05-11 10:02 +0100
        Re: checking if a list is empty Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-11 12:14 +0000
          Re: checking if a list is empty Hans Georg Schaathun <hg@schaathun.net> - 2011-05-11 15:05 +0100
            Re: checking if a list is empty "D'Arcy J.M. Cain" <darcy@druid.net> - 2011-05-11 10:27 -0400
              Re: checking if a list is empty Hans Georg Schaathun <hg@schaathun.net> - 2011-05-11 18:59 +0100
                Re: checking if a list is empty alex23 <wuwei23@gmail.com> - 2011-05-11 20:16 -0700
                Re: checking if a list is empty Hans Georg Schaathun <hg@schaathun.net> - 2011-05-12 06:20 +0100
            Re: checking if a list is empty Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-11 15:50 +0000
              Re: checking if a list is empty Chris Angelico <rosuav@gmail.com> - 2011-05-12 02:05 +1000
                Re: checking if a list is empty Hans Georg Schaathun <hg@schaathun.net> - 2011-05-11 18:56 +0100
                Re: checking if a list is empty harrismh777 <harrismh777@charter.net> - 2011-05-11 16:13 -0500
          RE: checking if a list is empty "Prasad, Ramit" <ramit.prasad@jpmchase.com> - 2011-05-11 13:39 -0400
        Re: checking if a list is empty Roy Smith <roy@panix.com> - 2011-05-11 08:26 -0400
          Re: checking if a list is empty Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-11 13:29 +0000
          Re: checking if a list is empty Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-05-12 17:44 +1200
            Re: checking if a list is empty Hans Georg Schaathun <hg@schaathun.net> - 2011-05-12 07:06 +0100
            Re: checking if a list is empty Roy Smith <roy@panix.com> - 2011-05-12 07:36 -0400
              Re: checking if a list is empty Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-13 00:16 +0000
                Re: checking if a list is empty rusi <rustompmody@gmail.com> - 2011-05-12 23:46 -0700
                Re: checking if a list is empty Chris Rebert <clp2@rebertia.com> - 2011-05-13 01:02 -0700
                Re: checking if a list is empty rusi <rustompmody@gmail.com> - 2011-05-13 03:58 -0700
                Re: checking if a list is empty Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-05-14 14:34 +1200
                Re: checking if a list is empty David Robinow <drobinow@gmail.com> - 2011-05-14 10:28 -0400
                Re: checking if a list is empty Roy Smith <roy@panix.com> - 2011-05-14 11:04 -0400
                Re: checking if a list is empty Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-14 07:39 +0000
                Re: checking if a list is empty rusi <rustompmody@gmail.com> - 2011-05-14 00:45 -0700
                Re: checking if a list is empty Chris Angelico <rosuav@gmail.com> - 2011-05-14 23:42 +1000
                Re: checking if a list is empty rusi <rustompmody@gmail.com> - 2011-05-14 08:47 -0700
                Re: checking if a list is empty Chris Angelico <rosuav@gmail.com> - 2011-05-15 01:55 +1000
                Re: checking if a list is empty rusi <rustompmody@gmail.com> - 2011-05-14 10:43 -0700
                Re: checking if a list is empty Terry Reedy <tjreedy@udel.edu> - 2011-05-14 17:29 -0400
                Re: checking if a list is empty Ben Finney <ben+python@benfinney.id.au> - 2011-05-15 09:26 +1000
                Re: checking if a list is empty rusi <rustompmody@gmail.com> - 2011-05-14 19:41 -0700
                Re: checking if a list is empty Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-15 05:07 +0000
                Re: checking if a list is empty rusi <rustompmody@gmail.com> - 2011-05-15 10:33 -0700
                Re: checking if a list is empty Terry Reedy <tjreedy@udel.edu> - 2011-05-15 17:36 -0400
                Re: checking if a list is empty rusi <rustompmody@gmail.com> - 2011-05-15 22:56 -0700
                Re: checking if a list is empty Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-16 00:36 +0000
                Re: checking if a list is empty harrismh777 <harrismh777@charter.net> - 2011-05-15 20:59 -0500
                Re: checking if a list is empty rusi <rustompmody@gmail.com> - 2011-05-15 22:40 -0700
                Re: checking if a list is empty harrismh777 <harrismh777@charter.net> - 2011-05-15 20:25 -0500
                Re: checking if a list is empty Terry Reedy <tjreedy@udel.edu> - 2011-05-15 21:57 -0400
                Re: checking if a list is empty Terry Reedy <tjreedy@udel.edu> - 2011-05-14 16:59 -0400
                Re: checking if a list is empty Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-15 05:00 +0000
                Re: checking if a list is empty Terry Reedy <tjreedy@udel.edu> - 2011-05-14 16:53 -0400
          Re: checking if a list is empty Terry Reedy <tjreedy@udel.edu> - 2011-05-12 15:37 -0400
          Re: checking if a list is empty Terry Reedy <tjreedy@udel.edu> - 2011-05-12 18:00 -0400
  Re: checking if a list is empty Raymond Hettinger <python@rcn.com> - 2011-05-06 15:52 -0700

csiph-web