Re: Is Python Lazy?

2012-05-05 Thread Stefan Behnel
Dan Stromberg, 06.05.2012 07:40: > you probably won't be able to write a sort routine, and > use it as a "first 100 lowest values" routine for free. But you could > construct something that does almost the same thing lazily using a > generator - not for free. OTOH, if you really wanted to do this

Re: Is Python Lazy?

2012-05-05 Thread Dan Stromberg
Generators and iterators are laziness where you tend to need laziness the most. Generator expressions are tiny generators - more full fledged generators are supported. Python probably won't have laziness at its core ever, but it's nice having a dose of it. IOW, you probably won't be able to writ

Is Python Lazy?

2012-05-05 Thread Emeka
Hello All, Could one say that generator expressions and functions are Python way of introducing Lazy concept? Regards, \Emeka -- *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Re: pyjamas / pyjs

2012-05-05 Thread alex23
On May 4, 11:43 pm, Duncan Booth wrote: > In case it isn't obvious why I might be subscribed but emails turned off, I > read mailing lists like that through gmane in which case I still need to > sign up to the list to post but definitely don't want to receive emails. This. I was surprised to sudd

Re: Problem with time.time() standing still

2012-05-05 Thread Chris Angelico
On Sun, May 6, 2012 at 6:51 AM, Bob Cowdery wrote: > The time.clock() function does increment correctly. CPU is around 30% 30% of how many cores? If that's a quad-core processor, that could indicate one core completely pegged plus a little usage elsewhere. ChrisA -- http://mail.python.org/mailm

Re: Problem with time.time() standing still

2012-05-05 Thread Cameron Simpson
On 05May2012 20:33, Bob Cowdery wrote: | I've written a straight forward extension that wraps a vendors SDK for a | video capture card. All works well except that in the Python thread on | which I call the extension, after certain calls that I believe are using | DirectShow, time stands still. Th

Re: Problem with time.time() standing still

2012-05-05 Thread Bob Cowdery
Thanks Daniel, that's interesting. Unfortunately there is no sensible code I can post because this only happens when I make a specific call into the vendors SDK. I can exercise my own code in the extension without a problem. The python test calling code is doing practically nothing. I make 3 calls

Re: Problem with time.time() standing still

2012-05-05 Thread Danyel Lawson
Add a time.sleep(0) call to all your loops. Multithreading in Python is a cooperative cross platform threading simulation if you have tight loops Python won't task switch until you make a system call. Potentially preventing internal library variables from being updated. Your five minute interval m

Problem with time.time() standing still

2012-05-05 Thread Bob Cowdery
Hi all, I've been a long time user of Python and written many extensions but this problem has me stumped. I've written a straight forward extension that wraps a vendors SDK for a video capture card. All works well except that in the Python thread on which I call the extension, after certain calls

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-05 Thread Peng Yu
> Documentation that takes ten pages to say something is just as bad as > documentation that leaves stuff out, because it's almost guaranteed > that it won't be read. That's the point. If a simple example (6 lines) can demonstrate the concept, why spending "ten pages" to explain it. My experience

Re: How to compute a delta: the difference between lists of strings

2012-05-05 Thread Vito De Tullio
J. Mwebaze wrote: > This is out of curiosity, i know this can be done with python diffllib > module, but been figuring out how to compute the delta, Consider two lists > below. > > s1 = ['e', 'f', 'g', 'A', 'B', 'C', 'D', 'C'] > s2 =['e', 'A', 'B', 'f', 'g', 'C', 'D', 'z'] > > This is the result

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-05 Thread Emile van Sebille
On 5/5/2012 4:04 AM Peng Yu said... I agree that people have different opinions on issues like this. But I think that "The Customer Is God". Readers of the doc is the customers, the writers of the doc is the producers. The opinion of customers should carry more weight than producers. Only to a

Re: How to compute a delta: the difference between lists of strings

2012-05-05 Thread Emile van Sebille
On 5/5/2012 5:12 AM J. Mwebaze said... This is out of curiosity, i know this can be done with python diffllib module, but been figuring out how to compute the delta, Consider two lists below. s1 = ['e', 'f', 'g', 'A', 'B', 'C', 'D', 'C'] s2 =['e', 'A', 'B', 'f', 'g', 'C', 'D', 'z'] This is the

Re: How to compute a delta: the difference between lists of strings

2012-05-05 Thread J. Mwebaze
thank Chris.. On Sat, May 5, 2012 at 2:39 PM, Chris Angelico wrote:k > On Sat, May 5, 2012 at 10:12 PM, J. Mwebaze wrote: > > This is out of curiosity, i know this can be done with python diffllib > > module, but been figuring out how to compute the delta, Consider two > lists > > below. > > >

Re: How to compute a delta: the difference between lists of strings

2012-05-05 Thread Chris Angelico
On Sat, May 5, 2012 at 10:12 PM, J. Mwebaze wrote: > This is out of curiosity, i know this can be done with python diffllib > module, but been figuring out how to compute the delta, Consider two lists > below. > > s1 = ['e', 'f', 'g', 'A', 'B', 'C', 'D', 'C'] > s2 =['e', 'A', 'B', 'f', 'g', 'C', '

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-05 Thread Chris Angelico
On Sat, May 5, 2012 at 9:04 PM, Peng Yu wrote: > I agree that people have different opinions on issues like this. But I > think that "The Customer Is God". Readers of the doc is the customers, > the writers of the doc is the producers. The opinion of customers > should carry more weight than produ

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-05 Thread Peng Yu
Hi Terry, Thank you for you detailed email. > If two collections are equal, should the iteration order be the same? It has > always been true that if hash values collide, insertion order matters. > However, a good hash function avoids hash collisions as much as possible in > practical use cases.

Re: key/value store optimized for disk storage

2012-05-05 Thread Jon Clements
On Friday, 4 May 2012 16:27:54 UTC+1, Steve Howell wrote: > On May 3, 6:10 pm, Miki Tebeka wrote: > > > I'm looking for a fairly lightweight key/value store that works for > > > this type of problem: > > > > I'd start with a benchmark and try some of the things that are already in > > the standa