Not a big deal but ... Would it not be natural for date2num
> to accept an rrule as an argument? I.e., why force us to
> make a list of an rrule?
But rrules need a before and after to define their endpoints. What
would this interface to date2num look like?
I have no problem with this suggestions, but it might be more natural
to define
def rrule2num(after, before, rrule):
return date2num(rrule.between(after, before))
where after and before are datetime instances...
JDH
> Not a big deal but ... Would it not be natural for date2num
> to accept an rrule as an argument? I.e., why force us to
> make a list of an rrule?
But rrules need a before and after to define their endpoints. What
would this interface to date2num look like?
I have no problem with this suggestions, but it might be more natural
to define
def rrule2num(after, before, rrule):
return date2num(rrule.between(after, before))
where after and before are datetime instances...
return date2num(rrule.between(after, before))
I had in mind only rrules that specified the sample exactly,
so that they were already a finite iterable. E.g.,
x = rrule(MONTHLY,dtstart=date(1990,1,1),until=date(2005,1,1),inc=True)
Unfortunately rrule.count() will count forever, so I'm not
sure how best to check for finitude. I do *not* want to
propose a new function. It just seemed obvious that date2num
could easily handle such rrules, but I was thinking only of
fully delimited rrules.
Thanks,
Alan
···
On Wed, 13 Jul 2005, John Hunter apparently wrote: