Calendars and recurring events

Kragen Sitaker kragen at
Sun Jan 27 01:31:27 EST 2002

"Emile van Sebille" <emile at> writes:
> "Dave Swegen" <dswegen at> wrote in message
> news:mailman.1011954759.15321.python-list at
> > [...]
> Consider adding start and end date or times, eg to allow things like "12
> weekly sessions starting 12jun02" or
> "Modays starting 04Mar02", or my favorite missing feature: "Saturdays
> preceeding the 1st or 15th"  ;-)

What a coincidence!  Just this week I was wishing I had a calendaring
system that would automatically give me a list of Saturdays preceding
the 1st and 15th.  :)

> > My problem is that any time I want a view of events (say a one month
> > view), the program is going to have to traverse the whole list, and ask
> > if that event is due to be repeated for every day in that view. For one
> > month that would be ~30 traversals of the list, which seems disgusting in
> > its innefficiency.

It doesn't seem disgusting to me, because my Python executes 300 000
function calls per second; traversing the list of events 30 times and
calling a function on each one, each of which might do the work of
five function calls or so, will take half a millisecond.  If it takes
my calendar program half a millisecond to draw my calendar for this
month, that's pretty damned fast.

Still, if this did turn out to be a performance problem, you could
give your events an additional interface: "Give me the occurrences in
this date range."  Then you could call this on each event and merge
the results.

More information about the Python-list mailing list