>
> > Just for the sake of argument, here's the principle I'm working
> from:
> >
> > #
> lst = range(10)
> iterlst = iter(lst)
> iterlst.next()
> > 0
> for x in iterlst:
> > ... if x < 5:
> > ... print x
> > ... else:
> > ... break
> > ...
> > 1
> > 2
> > 3
>
I finally got my iterator-based version working, only to discover that
it's nearly four times slower than the brute-force multiple-loops
version I started with! Then I tried just adding an incrementing index
to the loop, so that each loop only ran through
self.events[last_index:], but that
On Tue, Aug 26, 2008 at 1:24 PM, Eric Abrahamsen
<[EMAIL PROTECTED]> wrote:
> On Aug 26, 2008, at 7:20 PM, Kent Johnson wrote:
>> If all you want to do with the nested Month, etc is to iterate the
>> events in them, you could probably use a shared iterator. It would
>> have to be able to push-back
"Eric Abrahamsen" <[EMAIL PROTECTED]> wrote
So that's why I'm creating the iterator outside of the while loop in
the original code, and then using a repeated for loop with a break
to step through all the events only once. Of course, the fact that
5 isn't in there probably points to the sourc
On Aug 26, 2008, at 7:20 PM, Kent Johnson wrote:
On Tue, Aug 26, 2008 at 1:36 AM, Eric Abrahamsen
<[EMAIL PROTECTED]> wrote:
So my test case: a Month has a 'child' attribute pointing at Week,
which has
a 'child' attribute pointing at Day, so they all know what kind of
child
instances itera
On Tue, Aug 26, 2008 at 1:36 AM, Eric Abrahamsen
<[EMAIL PROTECTED]> wrote:
> So my test case: a Month has a 'child' attribute pointing at Week, which has
> a 'child' attribute pointing at Day, so they all know what kind of child
> instances iteration should produce. With nested loops, a Month pro
I do apologize for the large quantities of confusing description –
articulating the problem here has helped me understand exactly what it
is I'm after (though it hasn't improved my code!), and I've got a
better grasp of the problem now than I did when I first asked.
It isn't so much that I
I'm not following your code very well. I don't understand the
relationship between the first loop and the iter_children() function.
A couple of things that might help:
- Django QuerySets can be qualified with additional tests, so you
could have each of your month/week/etc classes have its own corr
Okay I think I'm onto something, more iterator-related stuff. If I can
make self.events an iterator, then run a for loop on it, breaking out
of the loop when the events' date attributes get too high. Then on the
next run through, that same for loop should pick up where it left off,
right? H
On Aug 24, 2008, at 7:20 PM, Kent Johnson wrote:
Forwarding to the list with my reply. Please use Reply All to reply
to the list.
Grr, sorry, I keep forgetting...
On Sun, Aug 24, 2008 at 1:02 AM, Eric Abrahamsen
<[EMAIL PROTECTED]> wrote:
On Aug 23, 2008, at 11:22 PM, Kent Johnson wrot
On Sat, Aug 23, 2008 at 6:47 AM, Eric Abrahamsen
<[EMAIL PROTECTED]> wrote:
> At first I thought the bisect module was the way to go, but it is too
> tightly tied to integer list indices, and works very awkwardly when
> bisecting on datetime attributes.
I'm not sure what the problem is with bisect
Hi,
I've got a problem that takes a bit of explaining, but it's relatively
simple when you get down to it. This is another django-related thing,
but the issue itself is pure python.
I made a custom class, called an EventEngine, which represents a span
of time. You initialize it with a que
12 matches
Mail list logo