[Python-ideas] bool(datetime.time(0, 0))

Ben Finney ben+python at benfinney.id.au
Wed May 9 02:10:18 CEST 2012


Antoine Pitrou <solipsis at pitrou.net>
writes:

> On Tue, 08 May 2012 12:25:48 +0200
> Georg Brandl <g.brandl at gmx.net> wrote:
> > On 05/08/2012 11:56 AM, Antoine Pitrou wrote:
> > > On Tue, 8 May 2012 17:02:04 +1000
> > > Nick Coghlan <ncoghlan at gmail.com> wrote:
> > >> 
> > >> IMO, you've completely misdiagnosed the source of that bug. Never
> > >> *ever* rely on boolean evaluation when testing against None.
> > > 
> > > Nick, that's just plain silly. If we didn't want people to rely on
> > > boolean evaluation, we wouldn't define __bool__ at all (or we
> > > would make it return a random value).
> > 
> > Read again: he's talking about people using "bool(x)" (implicitly)
> > when they mean "x is not None".
>
> That's what I read.

Yet you mis-represent him, omitting the crucial qualifier “when testing
against None” when you quote him as saying “we don't want people to rely
on boolean evaluation”. Then you call your straw man silly.

-- 
 \        “I took it easy today. I just pretty much layed around in my |
  `\        underwear all day. … Got kicked out of quite a few places, |
_o__)                              though.” —Bug-Eyed Earl, _Red Meat_ |
Ben Finney




More information about the Python-ideas mailing list