[Pythonmac-SIG] Sets and Speed

2005-05-30 Thread Yair Benita
Hi All, My research involves genomic research and the use of sets (recently introduced in version 2.4) makes my life easier in a lot of ways. However, I noticed that working with large set slows the script to unbearable speed. Below I compare two simple scripts, one makes use of a list and the oth

Re: [Pythonmac-SIG] Sets and Speed

2005-05-30 Thread nickg
Hello, x = x.union(set([i]) is the problem. You are creating two new data structures (set[i], and x.union) at every iteration, and I suspect union is a slow operation. Just change this to "x.add(i)" and the script will run 20x faster than your list version! $ ./settest2.py done in 0.026

Re: [Pythonmac-SIG] Sets and Speed

2005-05-30 Thread Bob Ippolito
On May 30, 2005, at 7:44 AM, Yair Benita wrote: > My research involves genomic research and the use of sets (recently > introduced in version 2.4) makes my life easier in a lot of ways. > However, I > noticed that working with large set slows the script to unbearable > speed. Sets were actua

Re: [Pythonmac-SIG] PyOXIDE wishes?

2005-05-30 Thread gandreas
On May 29, 2005, at 7:38 PM, Lance Boyle wrote: > This sounds like a good idea to me. The Mathematica editor does this > and I can't remember any problems caused by it. > > Jerry > > > On May 28, 2005, at 5:03 AM, altern wrote: > > >> hi >> >> maybe a bit late but there it goes. >> I have been do

Re: [Pythonmac-SIG] Sets and Speed

2005-05-30 Thread Yair Benita
Dear Bob, your answer makes me feel very stupid and I think you're even angry at me for appearing stupid, or maybe for hinting that python was not good enough. Don't get me wrong, I love python, and will not switch to assembly any time soon Of course, I don't use that kind of code it was

Re: [Pythonmac-SIG] Sets and Speed

2005-05-30 Thread Bob Ippolito
On May 30, 2005, at 2:48 PM, Yair Benita wrote: > I usually combine 2 sets using union but one set is much smaller > than the other. It is better to do it using "add", as suggested, > and that is my solution. I didn't realize that using "add" will not > create redundancy, as you said these

[Pythonmac-SIG] Can't register Apple Help book with Carbon.AH module

2005-05-30 Thread Kevin Walzer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm trying to format some help docs into Apple Help format for an application I'm working on, but I can't get the help book registered. Here is my code: from Carbon import AH import os path = ?? AH.AHRegisterHelpBook(path) The difficulty I'm having i

Re: [Pythonmac-SIG] Can't register Apple Help book with Carbon.AH module

2005-05-30 Thread Bob Ippolito
On May 30, 2005, at 8:58 PM, Kevin Walzer wrote: > I'm trying to format some help docs into Apple Help format for an > application I'm working on, but I can't get the help book registered. > Here is my code: Did you try putting it in the Info.plist? It should be automatically registered by La

Re: [Pythonmac-SIG] Can't register Apple Help book with Carbon.AHmodule

2005-05-30 Thread Roger Binns
>> from Carbon import AH >> import os >> path = ?? >> AH.AHRegisterHelpBook(path) > > This stuff is probably way deprecated. Look in the Apple docs. That particular function isn't. The Apple docs basically say you can use the plist stuff (without giving sufficient detail for a non-Mac native de