Re: [Python-Dev] Getting values stored inside sets

2009-04-03 Thread Leif Walsh
On Fri, Apr 3, 2009 at 8:07 AM, Hrvoje Niksic wrote: > But I can't seem to find a way to retrieve the element corresponding to > 'foo', at least not without iterating over the entire set.  Is this an > oversight or an intentional feature?  Or am I just missing an obvious way to > do this? >>> que

Re: [Python-Dev] wait time [was: Ext4 data loss]

2009-03-12 Thread Leif Walsh
On Thu, 2009-03-12 at 20:25 +, Antoine Pitrou wrote: > I disagree. The user usually does not know which kind of flushing is needed in > order for his data to be safe. Actually, he probably doesn't even know what > flushing means, and that files are ever "closed". > > However, I also think that

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Leif Walsh
On Wed, Mar 4, 2009 at 7:53 AM, wrote: > I actually like StableDict best.  When I hear that I think, "ah, the > key order is stable in the face of insertions, unlike a regular dict". > Nor can I at the moment think of an alternative explanation of what a > "StableDict" might be. Hmm, perhaps a b

Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

2009-03-04 Thread Leif Walsh
On Wed, Mar 4, 2009 at 7:53 AM, wrote: > I actually like StableDict best.  When I hear that I think, "ah, the > key order is stable in the face of insertions, unlike a regular dict". > Nor can I at the moment think of an alternative explanation of what a > "StableDict" might be. +1 -- Cheers,

Re: [Python-Dev] svn (403 Forbidden)

2009-03-04 Thread Leif Walsh
On Wed, Mar 4, 2009 at 8:18 AM, Luis Saavedra wrote: > how to fix this problem?, on another machine I don't have this problem..., Which machines does it work/fail on? I probably can't help you, but maybe that will help someone else figure it out. -- Cheers, Leif ___

Re: [Python-Dev] A suggestion: Do proto-PEPs in Google Docs

2009-02-26 Thread Leif Walsh
On Thu, Feb 19, 2009 at 10:17 PM, Stephen J. Turnbull wrote: > Overall, I recommend use of Google Docs for "Python-Ideas" level of > PEP drafts. +1! I also like Google Sites for collaborative editing. -- Cheers, Leif ___ Python-Dev mailing list Pytho

Re: [Python-Dev] lifting of prohibition against readlines inside a "for line in file" in Py3?

2009-02-18 Thread Leif Walsh
On Wed, Feb 18, 2009 at 12:42 PM, Mitchell L Model wrote: > I'd appreciate comments -- especially a redirection to a different list, if > this one isn't appropriate for my query. It seems as though you have the right list, but perhaps whoever knows about the change is busy, or maybe several peopl

Re: [Python-Dev] Wow!

2009-02-16 Thread Leif Walsh
On Fri, Feb 13, 2009 at 9:14 PM, Greg Ewing wrote: > Also it sounds like they could do with a really good > garbage collection algorithm just now. If only we had a second Earth to mess with, we could just copy and swap. -- Cheers, Leif ___ Python-Dev

Re: [Python-Dev] Partial function application 'from the right'

2009-01-31 Thread Leif Walsh
On Fri, Jan 30, 2009 at 7:38 PM, Calvin Spealman wrote: > I am just replying to the end of this thread to throw in a reminder > about my partial.skip patch, which allows the following usage: > > split_one = partial(str.split, partial.skip, 1) > > Not looking to say "mine is better", but if the ide

Re: [Python-Dev] Partial function application 'from the right'

2009-01-29 Thread Leif Walsh
On Thu, Jan 29, 2009 at 9:12 AM, Ben North wrote: > I find 'functools.partial' useful, but occasionally I'm unable to use it > because it lacks a 'from the right' version. E.g., to create a function > which splits a string on commas, you can't say First of all, many functions like this are easy

Re: [Python-Dev] python.org OS

2009-01-04 Thread Leif Walsh
On Sun, Jan 4, 2009 at 8:51 PM, Steve Holden wrote: > Ubuntu is a victim of its own success. They now have to deal with the > same diversity of hardware environments as Windows. I hope that > Canonical will find a way to stabilize things. I think it's actually worse. Microsoft can always (and, i

Re: [Python-Dev] How to configure with icc on Mac?

2009-01-04 Thread Leif Walsh
On Sun, Jan 4, 2009 at 12:05 PM, wrote: > Hmmm, OK... Why do we need two ways to spell "don't use gcc"? Think of it like the two keys to the atom bomb. :-P -- Cheers, Leif ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mail

Re: [Python-Dev] python.org OS

2009-01-04 Thread Leif Walsh
I missed the beginning here; oh well. On Sun, Jan 4, 2009 at 9:51 AM, Aahz wrote: > On Sun, Jan 04, 2009, Stephen J. Turnbull wrote: >> Steve Holden writes: >>> >>> Hey, isn't Ubuntu Debian-based? ... >> >> Ouch. I don't actually use Ubuntu, but when everybody on my local LUG >> list from the "L

Re: [Python-Dev] extremely slow exit for program having huge (45G) dict (python 2.5.2)

2008-12-20 Thread Leif Walsh
On Sat, Dec 20, 2008 at 4:11 PM, Tim Peters wrote: > [Lots of answers] Thanks. Wish I could have offered something useful. -- Cheers, Leif ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscrib

Re: [Python-Dev] extremely slow exit for program having huge (45G) dict (python 2.5.2)

2008-12-20 Thread Leif Walsh
(@Skip, Michael, Tim) On Sat, Dec 20, 2008 at 3:26 PM, wrote: > Because useful side effects are sometimes performed as a result of this > activity (flushing disk buffers, closing database connections, etc). Of course they are. But what about the case given above: On Sat, Dec 20, 2008 at 5:55

Re: [Python-Dev] extremely slow exit for program having huge (45G) dict (python 2.5.2)

2008-12-20 Thread Leif Walsh
On Sat, Dec 20, 2008 at 3:04 PM, M.-A. Lemburg wrote: > These long exit times are usually caused by the garbage collection > of objects. This can be a very time consuming task. In that case, the question would be "why is the interpreter collecting garbage when it knows we're trying to exit anyway

Re: [Python-Dev] Python for windows.

2008-11-26 Thread Leif Walsh
This list is for the development of python. Questions about programming with python go to c.l.python or python-list at python dot org. If your question is about the development of python, you can probably just ask here. On Wed, Nov 26, 2008 at 2:06 PM, Koenig, Gerald <[EMAIL PROTECTED]> wrote: >

Re: [Python-Dev] Feedback from numerical/math community on PEP 225

2008-11-09 Thread Leif Walsh
On Fri, Nov 7, 2008 at 11:01 PM, Fernando Perez <[EMAIL PROTECTED]> wrote: > a while back there was a discussion about new operators for the language, > which > ended in people mentioning that the status of PEP 225 was still undecided and > that it was the most likely route to consider in this dis

Re: [Python-Dev] DVCS PEP update

2008-11-06 Thread Leif Walsh
On Thu, Nov 6, 2008 at 8:04 AM, Dirkjan Ochtman <[EMAIL PROTECTED]> wrote: > I can represent Mercurial, though it may be (more?) helpful if some of the > Mercurial-using python-dev regulars can occasionally step in. I like mercurial, so I'll do this if I see something, but I don't use it for anyth

Re: [Python-Dev] Why don't range and xrange threat floats as floats?

2008-11-05 Thread Leif Walsh
On Wed, Nov 5, 2008 at 1:26 PM, L V <[EMAIL PROTECTED]> wrote: > Why don't range and xrange threat floats as floats? > Is there any good reason range and xrange don't threat floats as floats but > as integers? > When I enter float arguments in a range, the floats are treated as integers. > (+ some

Re: [Python-Dev] Fwd: Removal of GIL through refcounting removal.

2008-10-30 Thread Leif Walsh
On Thu, Oct 30, 2008 at 1:07 PM, VanL <[EMAIL PROTECTED]> wrote: > Just an FYI, these two particular students already introduced themselves > on the PyPy list. Paolo is a masters student with experience in the > Linux kernel; Sigurd is a PhD candidate. > > Their professor is Lars Bak, the lead arch

Re: [Python-Dev] if-syntax for regular for-loops

2008-10-03 Thread Leif Walsh
On Fri, Oct 3, 2008 at 12:33 PM, Andreas Nilsson <[EMAIL PROTECTED]> wrote: > Thanks for the pointer! > I don't buy the argument that newlines automagically improves readability > though. You also get increased nesting suggesting something interesting is > happening where it isn't and that hurts re

Re: [Python-Dev] if-syntax for regular for-loops

2008-10-03 Thread Leif Walsh
On Fri, Oct 3, 2008 at 6:10 AM, Andreas Nilsson <[EMAIL PROTECTED]> wrote: > With that out of the way, on to todays subject: > I use list comprehensions and generator expressions a lot and lately I've > found myself writing a lot of code like this: > > for i in items if i.some_field == some_value:

Re: [Python-Dev] fileobj.read(float): warning or error?

2008-07-22 Thread Leif Walsh
On Tue, Jul 22, 2008 at 3:46 PM, Cameron Simpson <[EMAIL PROTECTED]> wrote: > [ Don't you mean "min()"? Unimportant. ] Haha, that's what I get for not actually _running_ the code example. > I see the convenience here, but doubt I'd ever do that myself. > I'd write the above like this: > > while

Re: [Python-Dev] fileobj.read(float): warning or error?

2008-07-21 Thread Leif Walsh
On Tue, 22 Jul 2008, Cameron Simpson wrote: > Leaving aside the 0.2 => 0 converstion, shouldn't read() raise an > exception if asked for < 1 bytes? Or is there a legitimate use for > read(0) with which I was not previously aware? I think read(0) should be a no-op, just like it is in libc. This le

Re: [Python-Dev] [Python-checkins] r64424 - in python/trunk: Include/object.h Lib/test/test_sys.py Misc/NEWS Objects/intobject.c Objects/longobject.c Objects/typeobject.c Python/bltinmodule.c

2008-06-24 Thread Leif Walsh
On Tue, 24 Jun 2008, Nick Coghlan wrote: > I'd prefer to see a proper PEP for this proposing a new slot that lets any > class return an (integer_part, fraction_part) tuple of integers, and > have PyNumber_ToBase take care of the actual string formatting. I take issue only with your notion of retu

Re: [Python-Dev] [Python-3000] RELEASED Python 2.6b1 and 3.0b1

2008-06-21 Thread Leif Walsh
There is a typo on the download page (http://python.org/download/releases/3.0/): """The release plan is to have a series of alpha releases in 2007, beta releases in 2008, and a final release in September 2008. The alpha releases are primarily aimed at developers who want a sneak peek at the new la

Re: [Python-Dev] [Python-3000] RELEASED Python 2.6b1 and 3.0b1

2008-06-21 Thread Leif Walsh
There is a typo on the download page (http://python.org/download/releases/3.0/): """The release plan is to have a series of alpha releases in 2007, beta releases in 2008, and a final release in September 2008. The alpha releases are primarily aimed at developers who want a sneak peek at the new la

Re: [Python-Dev] Proposal: Run GC less often

2008-06-21 Thread Leif Walsh
If you can get me a version of the interpreter with this change made (I wouldn't know what to change), I can run a very allocation/deallocation-heavy application I have lying around, and get you some good benchmarks. On Sat, Jun 21, 2008 at 1:23 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: - S

Re: [Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

2008-06-15 Thread Leif Walsh
-1 to this 'on' statement. On Sat, Jun 14, 2008 at 10:14 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > It isn't that a Pascal-with-style statement can't be achieved, it's that it > is pointless syntactic sugar in Python. Just use o = > long_complicated_object_name instead. +1 to this reason. --

Re: [Python-Dev] Assignment to None

2008-06-12 Thread Leif Walsh
On Thu, Jun 12, 2008 at 10:28 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > That makes about as much sense as wanting to support a.42 = b since > a[42] = b works. :-) Well don't I feel silly now. -- Cheers, Leif ___ Python-Dev mailing list Python-D

Re: [Python-Dev] Assignment to None

2008-06-12 Thread Leif Walsh
I haven't been following this thread very closely, so I'm not sure what the status is, but I'd just like to point out that yesterday I used the fact that a[None] = b works, when I used the @memoize decorator from the wiki. This seems to provide an argument that, for symmetry's sake, we might want

Re: [Python-Dev] Addition of "pyprocessing" module to standard lib.

2008-05-22 Thread Leif Walsh
On Thu, 22 May 2008, "Martin v. Löwis" wrote: > > I would say that writing portable C code is hard as well, aren't there > > just more tools that help? > > The C compiler in particular. It already gets symbolic constants and > struct layouts right, something that ctypes can't do (because it doesn't

Re: [Python-Dev] Possible bug in re module?

2008-05-20 Thread Leif Walsh
On Tue, 20 May 2008, Dmitry Vasiliev wrote: > I've just found a strange re behavior: > > >>> import re > >>> re.sub("(?:ab|b|a)", "+", "cbacbabcabc") > 'c++c++c+c' > >>> re.sub("(?:ab|b|a){2}", "+", "cbacbabcabc") > 'c+c+c+c' > > In the last case |-separated expressions seems don't tried from left

Re: [Python-Dev] Addition of "pyprocessing" module to standard lib.

2008-05-20 Thread Leif Walsh
On Mon, 19 May 2008, Bill Janssen wrote: > > On Mon, May 19, 2008 at 5:15 PM, Bill Janssen <[EMAIL PROTECTED]> wrote: > > >> If you can run a pure Python module > > >> that does not depend on any C extension, then that platform has the > > >> support needed to run Python. > > > > > > This is certai

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-03 Thread Leif Walsh
On Sat, 3 May 2008, Brett Cannon wrote: > On Sat, May 3, 2008 at 1:03 AM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > Some people write > > somename = lambda args: expression > > instead of the more obvious (to most people) and, dare I say, standard > > def somename(args): return expression

Re: [Python-Dev] [Python-3000] Invitation to try out open source code review tool

2008-05-01 Thread Leif Walsh
On Thu, 1 May 2008, Neal Becker wrote: > It would be really nice to see support for some other backends, such as Hg > or bzr (which are both written in python), in addition to svn. /me starts the clamour for git -- Cheers, Leif ___ Python-Dev mailing l

Re: [Python-Dev] unittest's redundant assertions: asserts vs. failIf/Unlesses

2008-03-19 Thread Leif Walsh
On Wed, Mar 19, 2008 at 7:05 PM, Paul Moore <[EMAIL PROTECTED]> wrote: > > This strikes me as a gratuitous API change of the kind Guido was > > warning about in his recent post: "Don't change your APIs incompatibly > > when porting to Py3k" > > This seems compelling to me. And as Glyph mentio

Re: [Python-Dev] [OT] Re: getpass and stdin

2008-02-26 Thread Leif Walsh
On Tue, Feb 26, 2008 at 2:14 PM, Shaya Potter <[EMAIL PROTECTED]> wrote: > 1) I am willing to type in the password, which is obvious to anyone who > can read a simple script. That just doesn't work for a program you want > to run in the background to type it in every time. I recommend you just ha

Re: [Python-Dev] getpass and stdin

2008-02-26 Thread Leif Walsh
On Tue, Feb 26, 2008 at 1:18 PM, Shaya Potter <[EMAIL PROTECTED]> wrote: > I want to run a program within a bash script, essentially daemonize a > program that doesn't have a daemon mode. > > #!/bin/sh > > echo "What Is Your Passsword: " > stty_orig=`stty -g` > stty -echo > read -r PASSWORD

Re: [Python-Dev] getpass and stdin

2008-02-26 Thread Leif Walsh
On Tue, Feb 26, 2008 at 12:43 PM, Shaya Potter <[EMAIL PROTECTED]> wrote: > the -p option is not good on multi user systems > the -p option is not particularly good on NFS based systems > (have to trust every user on every machine with access to NFS share) You seem somehow both worried about

Re: [Python-Dev] getpass and stdin

2008-02-26 Thread Leif Walsh
On Sun, Feb 24, 2008 at 1:02 PM, Shaya Potter <[EMAIL PROTECTED]> wrote: > [please cc me on responses] > > I was wondering if getpass could be changed to enable piped stdin to work. > > For instance, the getmail program can read my email password in via > stdin using getpass functionality. > >

Re: [Python-Dev] trunc()

2008-01-25 Thread Leif Walsh
On Jan 25, 2008 12:45 PM, Facundo Batista <[EMAIL PROTECTED]> wrote: > Mmm... no. int() is a builtin way to transform the builtin data type > float into the builtin data type float [sic]. > > There's no "correct" way for a float to become an integer, but in the > math module you have several ways t

Re: [Python-Dev] Rational approximation methods

2008-01-20 Thread Leif Walsh
On 1/20/08, Paul Moore <[EMAIL PROTECTED]> wrote: > Both of these are likely to be of limited use. The most common usage I > know of is to make a "sensible" rational from a float (i.e., a DWIM > style conversion 0.1 -> 1/10) or to provide readable output. On the > other hand, both are subtle to imp

Re: [Python-Dev] PEP: per user site-packages directory

2008-01-14 Thread Leif Walsh
On Jan 14, 2008 6:41 PM, Jon Ribbens <[EMAIL PROTECTED]> wrote: > It makes sense, but personally I have never heard before of ~/.local. > Whereas ~/bin is something I am quite familiar with. *raises hand* I have one, fwiw. -- Cheers, Leif ___ Python-De

Re: [Python-Dev] Rounding Decimals

2008-01-13 Thread Leif Walsh
On Jan 13, 2008 7:26 PM, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > Guido mentioned the possibility briefly at > http://mail.python.org/pipermail/python-3000/2007-April/007015.html > ("One could argue that float and Decimal are <:Q, but I'm not sure if > that makes things better pragmatically") b

Re: [Python-Dev] Rounding Decimals

2008-01-13 Thread Leif Walsh
On Jan 13, 2008 6:12 PM, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > On Jan 12, 2008 8:21 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > > On Jan 12, 2008 5:09 PM, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > > > During the discussion about the new Rational implementation > > > (http://bugs