[Zope-Coders] Re: [Zope-Checkins] CVS:
Zope/lib/python/Products/PluginIndexes/DateRangeIndex -
DateRangeIndex.py:1.6.2.2
Chris McDonough
chrism at plope.com
Tue Nov 4 09:58:56 EST 2003
OK, I give. I've backed out the magic. I explicitly raise a ValueError
when the thing is a long. This makes the problem easier to figure out
when you run in to it.
> > Hmm. The CEILING_DATE thing is really where the problem will occur 99%
> > of the time, maybe we could just change that to Y2038 and allow the
> > index to continue to throw the error?
>
> That is pretty funny, given that the DateRangeIndex should make the
> whole CEILING_DATE / FLOOR_DATE bullshit unnecessary (we want to be
> returning None for those values if we actually use a *real* DRI /
> DateIndex): CEILING_DATE actually defeats DRI's handling of "half-open"
> and "open" ranges!
Yeah, I didn't think of this! ;-)
> > Good point. It appears to make no concession, which is fine, but the
> > failure cases aren't equivalent for the reasons I mentioned above.
>
> I don't see why: trying to index an inappropriate value is still the
> application programmer's error (in this case, that programmer is *me*,
> just in case it looks like I'm passing the buck here).
In this case, the application programmer was *me*, innocently trying to
use effective/expires in a DateRange index. You played the part of the
evil systems programmer with the twisty moustache. ;-)
- C
More information about the Zope-Coders
mailing list