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

2012-05-04 Thread Terry Reedy
Peng, I actually am thinking about it. Underlying problem: while unordered means conceptually unordered as far as the collection goes, the items in the collection, if homogenous enough, may have a natural order, which users find hard to ignore. Even if not comparable, an implementation such as

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

2012-05-04 Thread Mark Lawrence
On 05/05/2012 00:37, Peng Yu wrote: My point is if something is said in the document, it is better to be substantiated by an example. I don't think that this has anything with "learn the spec from behaviour." I side with the comments made by Terry Reedy and Cameron Simpson so please give it

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

2012-05-04 Thread Peng Yu
On Fri, May 4, 2012 at 6:12 PM, Cameron Simpson wrote: > On 04May2012 15:08, Peng Yu wrote: > | On Fri, May 4, 2012 at 12:43 PM, Terry Reedy wrote: > | > On 5/4/2012 8:00 AM, Peng Yu wrote: > | >> On Fri, May 4, 2012 at 6:21 AM, Chris Angelico  wrote: > | >>> On Fri, May 4, 2012 at 8:14 PM, Peng

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

2012-05-04 Thread Cameron Simpson
On 04May2012 15:08, Peng Yu wrote: | On Fri, May 4, 2012 at 12:43 PM, Terry Reedy wrote: | > On 5/4/2012 8:00 AM, Peng Yu wrote: | >> On Fri, May 4, 2012 at 6:21 AM, Chris Angelico  wrote: | >>> On Fri, May 4, 2012 at 8:14 PM, Peng Yu  wrote: | Thanks. This is what I'm looking for. I think t

Re: recruiter spam

2012-05-04 Thread Chris Withers
Please don't spam the list with job adverts, post to the job board instead: http://www.python.org/community/jobs/howto/ cheers, Chris On 03/05/2012 22:13, Preeti Bhattad wrote: Hi there, If you have USA work visa and if you reside in USA; -- Simplistix - Content Management, Batch Processin

Re: for loop: weird behavior

2012-05-04 Thread Terry Reedy
On 5/4/2012 4:33 PM, ferreirafm wrote: Hi there, I simply can't print anything in the second for-loop bellow: # #!/usr/bin/env python import sys filename = sys.argv[1] outname = filename.split('.')[0] + '_pdr.dat' begin = 'Distance distribution' end = 'R

for loop: weird behavior

2012-05-04 Thread ferreirafm
Hi there, I simply can't print anything in the second for-loop bellow: # #!/usr/bin/env python import sys filename = sys.argv[1] o

Re: key/value store optimized for disk storage

2012-05-04 Thread Emile van Sebille
On 5/4/2012 12:49 PM Tim Chase said... On 05/04/12 14:14, Emile van Sebille wrote: On 5/4/2012 10:46 AM Tim Chase said... I hit a few snags testing this on my winxp w/python2.6.1 in that getsize wasn't finding the file as it was created in two parts with .dat and .dir extension. Hrm...must be

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

2012-05-04 Thread Peng Yu
On Fri, May 4, 2012 at 12:43 PM, Terry Reedy wrote: > On 5/4/2012 8:00 AM, Peng Yu wrote: >> >> On Fri, May 4, 2012 at 6:21 AM, Chris Angelico  wrote: >>> >>> On Fri, May 4, 2012 at 8:14 PM, Peng Yu  wrote: Thanks. This is what I'm looking for. I think that this should be added to t

pickle question: sequencing of operations

2012-05-04 Thread Russell E. Owen
What is the sequence of calls when unpickling a class with __setstate__? >From experimentation I see that __setstate__ is called and __init__ is not, but I think I need more info. I'm trying to pickle an instance of a class that is a subclass of another class that contains unpickleable objects.

Re: key/value store optimized for disk storage

2012-05-04 Thread Tim Chase
On 05/04/12 14:14, Emile van Sebille wrote: > On 5/4/2012 10:46 AM Tim Chase said... > > I hit a few snags testing this on my winxp w/python2.6.1 in that getsize > wasn't finding the file as it was created in two parts with .dat and > .dir extension. Hrm...must be a Win32 vs Linux thing. > Als

Re: key/value store optimized for disk storage

2012-05-04 Thread Emile van Sebille
On 5/4/2012 10:46 AM Tim Chase said... I hit a few snags testing this on my winxp w/python2.6.1 in that getsize wasn't finding the file as it was created in two parts with .dat and .dir extension. Also, setting key failed as update returns None. The changes I needed to make are marked below.

RE: most efficient way of populating a combobox (in maya)

2012-05-04 Thread Prasad, Ramit
> > I'm making a GUI in maya using python only and I'm trying to see which > > is more efficient. I'm trying to populate an optionMenuGrp / combo box > > whose contents come from os.listdir(folder). Now this is fine if the > > folder isn't that full but the folder has a few hundred items (almost in

Re: key/value store optimized for disk storage

2012-05-04 Thread Tim Chase
On 05/04/12 12:22, Steve Howell wrote: > Which variant do you recommend? > > """ anydbm is a generic interface to variants of the DBM database > — dbhash (requires bsddb), gdbm, or dbm. If none of these modules > is installed, the slow-but-simple implementation in module > dumbdbm will be used. >

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

2012-05-04 Thread Terry Reedy
On 5/4/2012 8:00 AM, Peng Yu wrote: On Fri, May 4, 2012 at 6:21 AM, Chris Angelico wrote: On Fri, May 4, 2012 at 8:14 PM, Peng Yu wrote: Thanks. This is what I'm looking for. I think that this should be added to the python document as a manifestation (but nonnormalized) of what "A set object

Re: key/value store optimized for disk storage

2012-05-04 Thread Tim Chase
On 05/04/12 10:27, 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 standard library: >> - bsddb >> -

Re: syntax for code blocks

2012-05-04 Thread Temia Eszteri
You know what I find rich about all of this? >>>[ ... ]> I'd like to change the syntax of my module 'codeblocks' to make it >>>more >>>[ ... ]> pythonic. Kiuhnm posted a thread to the group asking us to help him make it more Pythonic, but he has steadfastly refused every single piece of help he

Re: key/value store optimized for disk storage

2012-05-04 Thread Steve Howell
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 > standard library: > - bsddb > - sqlite3 (table of key, value, index key) > -

Re: syntax for code blocks

2012-05-04 Thread Michael Torrie
On 05/04/2012 05:12 AM, Kiuhnm wrote: >> Hand-wavy, no real example, doesn't make sense. > > Really? Then I don't know what would make sense to you. Speaking as as an observer here, I've read your blog post, and looked at your examples. They don't make sense to me either. They aren't real examp

Re: "

2012-05-04 Thread Ian Kelly
On Fri, May 4, 2012 at 12:57 AM, Stefan Behnel wrote: > Ian Kelly, 04.05.2012 01:02: >> BeautifulSoup is supposed to parse like a browser would > > Not at all, that would be html5lib. Well, I guess that depends on whether we're talking about BeautifulSoup 3 (a regex-based screen scraper with meth

Re: set PYTHONPATH for a directory?

2012-05-04 Thread Pedro Larroy
Isn't virtualenv for this kind of scenario? Pedro. On Fri, May 4, 2012 at 3:46 PM, Dave Angel wrote: > On 05/04/2012 08:21 AM, Neal Becker wrote: >> I'm testing some software I'm building against an alternative version of a >> library.  So I have an alternative library in directory L.  Then I h

Re: set PYTHONPATH for a directory?

2012-05-04 Thread Dave Angel
On 05/04/2012 08:21 AM, Neal Becker wrote: > I'm testing some software I'm building against an alternative version of a > library. So I have an alternative library in directory L. Then I have in an > unrelated directory, the test software, which I need to use the library > version > from dire

Re: pyjamas / pyjs

2012-05-04 Thread Duncan Booth
james hedley wrote: > There's also an allegation, which I am not making myself at this point > - only describing its nature, that a person may have lifted data from > the original mail server without authorisation and used it to recreate > the mailing list on a different machine. *If* that were t

Re: numpy (matrix solver) - python vs. matlab

2012-05-04 Thread someone
On 05/04/2012 06:15 AM, Russ P. wrote: On May 3, 4:59 pm, someone wrote: On 05/04/2012 12:58 AM, Russ P. wrote: Ok, but I just don't understand what's in the "empirical" category, sorry... I didn't look it up, but as far as I know, empirical just means based on experiment, which means based o

Re: numpy (matrix solver) - python vs. matlab

2012-05-04 Thread someone
On 05/04/2012 05:52 AM, Steven D'Aprano wrote: On Thu, 03 May 2012 19:30:35 +0200, someone wrote: So how do you explain that the natural frequencies from FEM (with condition number ~1e6) generally correlates really good with real measurements (within approx. 5%), at least for the first 3-4 nat

set PYTHONPATH for a directory?

2012-05-04 Thread Neal Becker
I'm testing some software I'm building against an alternative version of a library. So I have an alternative library in directory L. Then I have in an unrelated directory, the test software, which I need to use the library version from directory L. One approach is to set PYTHONPATH whenever I

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

2012-05-04 Thread Peng Yu
On Fri, May 4, 2012 at 6:21 AM, Chris Angelico wrote: > On Fri, May 4, 2012 at 8:14 PM, Peng Yu wrote: >> Thanks. This is what I'm looking for. I think that this should be >> added to the python document as a manifestation (but nonnormalized) of >> what "A set object is an unordered collection of

Re: syntax for code blocks

2012-05-04 Thread Chris Angelico
On Fri, May 4, 2012 at 9:12 PM, Kiuhnm wrote: > If I and my group of programmers devised a good and concise syntax and > semantics to describe some applicative domain, then we would want to > translate that into the language we use. > Unfortunately, Python doesn't let you do that. No, this is not

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

2012-05-04 Thread Chris Angelico
On Fri, May 4, 2012 at 8:14 PM, Peng Yu wrote: > Thanks. This is what I'm looking for. I think that this should be > added to the python document as a manifestation (but nonnormalized) of > what "A set object is an unordered collection of distinct hashable > objects" means. There are other things

Re: syntax for code blocks

2012-05-04 Thread Kiuhnm
On 5/4/2012 4:44, alex23 wrote: On May 4, 2:17 am, Kiuhnm wrote: On 5/3/2012 2:20, alex23 wrote: locals() is a dict. It's not injecting anything into func's scope other than a dict so there's not going to be any name clashes. If you don't want any of its content in your function's scope, just

Re: pyjamas / pyjs

2012-05-04 Thread james hedley
By the way, there's a lot more to say on this, which I'll cover another time. There are arguments for and against what's happened; at this stage I'm just trying to flag up that there is *not* unanimity and we are not just carrying on as normal. -- http://mail.python.org/mailman/listinfo/python-

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

2012-05-04 Thread Peng Yu
On Thu, May 3, 2012 at 11:16 PM, Terry Reedy wrote: > On 5/3/2012 8:36 PM, Peng Yu wrote: >> >> Hi, >> >> list(a_set) >> >> When convert two sets with the same elements to two lists, are the >> lists always going to be the same (i.e., the elements in each list are >> ordered the same)? Is it docum

Re: pyjamas / pyjs

2012-05-04 Thread james hedley
On Thursday, 3 May 2012 12:52:36 UTC+1, alex23 wrote: > Anyone else following the apparent hijack of the pyjs project from its > lead developer? Yes, me. The guy now in control got the owner of the domain name to turn it over to him, which is probably ok legally, but he had no public mandate or

Re: key/value store optimized for disk storage

2012-05-04 Thread Paul Rubin
Steve Howell writes: >> You should be able to just get the incremental bit. > This is fixed now. Nice. > It it's in the header, wouldn't it be part of the output that comes > before Z_SYNC_FLUSH? Hmm, maybe you are right. My version was several years ago and I don't remember it well, but I hal

Re: pyjamas / pyjs

2012-05-04 Thread Terry Reedy
On 5/4/2012 12:52 AM, John O'Hagan wrote: Just read the thread on pyjamas-dev. Even without knowing anything about the lead-up to the coup, its leader's linguistic contortions trying to justify it And what is the name of the miscreant, so we know who to have nothing to with? -- Terry Jan Re

Re: Create directories and modify files with Python

2012-05-04 Thread Hans Mulder
On 1/05/12 17:34:57, ru...@yahoo.com wrote: > from __future__ import print_function #1 > > > > #1: Not sure whether you're using Python 2 or 3. I ran > this on Python 2.7 and think it will run on Python 3 if > you remove this line.

Re: key/value store optimized for disk storage

2012-05-04 Thread Steve Howell
On May 4, 1:01 am, Paul Rubin wrote: > Steve Howell writes: > > Makes sense.  I believe I got that part correct: > > >  https://github.com/showell/KeyValue/blob/master/salted_compressor.py > > The API looks nice, but your compress method makes no sense.  Why do you > include s.prefix in s and the

Re: key/value store optimized for disk storage

2012-05-04 Thread Paul Rubin
Steve Howell writes: > Makes sense. I believe I got that part correct: > > https://github.com/showell/KeyValue/blob/master/salted_compressor.py The API looks nice, but your compress method makes no sense. Why do you include s.prefix in s and then strip it off? Why do you save the prefix and

Re: key/value store optimized for disk storage

2012-05-04 Thread Steve Howell
On May 3, 11:59 pm, Paul Rubin wrote: > Steve Howell writes: > >     compressor = zlib.compressobj() > >     s = compressor.compress("foobar") > >     s += compressor.flush(zlib.Z_SYNC_FLUSH) > > >     s_start = s > >     compressor2 = compressor.copy() > > I think you also want to make a decompr

Re: key/value store optimized for disk storage

2012-05-04 Thread Dan Stromberg
On Thu, May 3, 2012 at 11:03 PM, Paul Rubin wrote: > > Sort of as you suggest, you could build a Huffman encoding for a > > representative run of data, save that tree off somewhere, and then use > > it for all your future encoding/decoding. > > Zlib is better than Huffman in my experience, and Py

Re: key/value store optimized for disk storage

2012-05-04 Thread Paul Rubin
Steve Howell writes: > compressor = zlib.compressobj() > s = compressor.compress("foobar") > s += compressor.flush(zlib.Z_SYNC_FLUSH) > > s_start = s > compressor2 = compressor.copy() I think you also want to make a decompressor here, and initialize it with s and then clone it

Re: "

2012-05-04 Thread Stefan Behnel
Ian Kelly, 04.05.2012 01:02: > BeautifulSoup is supposed to parse like a browser would Not at all, that would be html5lib. Stefan -- http://mail.python.org/mailman/listinfo/python-list