On 20/03/2020 21:57, Barry wrote:
>
>
>> On 20 Mar 2020, at 00:42, duncan smith wrote:
>>
>> Bingo. Performance is indistinguishable from that of the list. Thread
>> safety is unimportant (for my purposes), but the docs at
>> https://docs.python.org/2/library/collections.html#collections.deque
>
On 20Mar2020 06:50, Dan Stromberg wrote:
Actually, I think a deque is a doubly linked list of python lists.
On 20Mar2020 09:45, Antoon Pardon wrote:
This doesn't seem correct. A deque is used to simulate a stack or a
queue. It doesn't use heappush or heappop.
You are both correct; brain fa
> On 20 Mar 2020, at 00:42, duncan smith wrote:
>
> Bingo. Performance is indistinguishable from that of the list. Thread
> safety is unimportant (for my purposes), but the docs at
> https://docs.python.org/2/library/collections.html#collections.deque
> state "Deques support thread-safe, memor
On Fri, 20 Mar 2020 06:50:29 -0700
Dan Stromberg wrote:
> On Thu, Mar 19, 2020 at 6:11 PM Cameron Simpson wrote:
>
> > >> 4. If it doesn't need to be thread-safe, why not try deques instead?
> > >
> > >Bingo. Performance is indistinguishable from that of the list.
> >
> > A deque is implement u
On Thu, Mar 19, 2020 at 6:11 PM Cameron Simpson wrote:
> >> 4. If it doesn't need to be thread-safe, why not try deques instead?
> >
> >Bingo. Performance is indistinguishable from that of the list.
>
> A deque is implement using a list.
>
Actually, I think a deque is a doubly linked list of pyt
Op 20/03/20 om 02:10 schreef Cameron Simpson:
On 20Mar2020 00:37, duncan smith wrote:
Thread
safety is unimportant (for my purposes), but the docs at
https://docs.python.org/2/library/collections.html#collections.deque
state "Deques support thread-safe, memory efficient appends and pops
from
On 20Mar2020 00:37, duncan smith wrote:
On 19/03/2020 20:40, MRAB wrote:
On 2020-03-19 20:08, duncan smith wrote:
I have generator code along the following lines,
Q = queue.Queue()
Q.put(x)
while not Q.empty():
x = Q.get()
if :
yield x
else:
Q.put()
If I
On 19/03/2020 20:40, MRAB wrote:
> On 2020-03-19 20:08, duncan smith wrote:
>> Hello,
>> I have generator code along the following lines,
>>
>>
>> Q = queue.Queue()
>> Q.put(x)
>> while not Q.empty():
>> x = Q.get()
>> if :
>> yield x
>> else:
>> Q.put()
>>
>>
On 2020-03-19 20:08, duncan smith wrote:
Hello,
I have generator code along the following lines,
Q = queue.Queue()
Q.put(x)
while not Q.empty():
x = Q.get()
if :
yield x
else:
Q.put()
If I change it to,
Q = []
Q.append(x)
for x in Q:
if :
Hello,
I have generator code along the following lines,
Q = queue.Queue()
Q.put(x)
while not Q.empty():
x = Q.get()
if :
yield x
else:
Q.put()
If I change it to,
Q = []
Q.append(x)
for x in Q:
if :
yield x
else:
Q.append()
then it runs a
10 matches
Mail list logo