Re: [Python-Dev] possible memory leak on windows (valgrind report)

2005-09-22 Thread Martin v. Löwis
Neal Norwitz wrote: I wonder if using attributes for other features would gain us much. I would really like to be able to use attributes for PyArgs_ParseTuple(), but I don't think gcc can use user defined formats. It's only printf AFAIR. Does anyone know if this isn't true and we can

Re: [Python-Dev] Mapping Darwin 8.2.0 to Mac OS X 10.4.2 in platform.py

2005-09-22 Thread Ronald Oussoren
On 22-sep-2005, at 5:26, Guido van Rossum wrote: The platform module has a way to map system names such as returned by uname() to marketing names. It maps SunOS to Solaris, for example. But it doesn't map Darwin to Mac OS X. I think I know how to map Darwin version numbers to OS X version

[Python-Dev] RELEASED Python 2.4.2, release candidate 1

2005-09-22 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.4.2 (release candidate 1). Python 2.4.2 is a bug-fix release. See the release notes at the website (also available as Misc/NEWS in the source distribution) for details of the more

Re: [Python-Dev] Mapping Darwin 8.2.0 to Mac OS X 10.4.2 in platform.py

2005-09-22 Thread M.-A. Lemburg
Ronald Oussoren wrote: On 22-sep-2005, at 5:26, Guido van Rossum wrote: The platform module has a way to map system names such as returned by uname() to marketing names. It maps SunOS to Solaris, for example. But it doesn't map Darwin to Mac OS X. I think I know how to map Darwin version

Re: [Python-Dev] IMPORTANT: release24-maint branch is FROZEN from 2005-09-21 00:00 UTC for 2.4.2

2005-09-22 Thread Reinhold Birkenfeld
Anthony Baxter wrote: Starting in about 11 hours time, the release24-maint branch is FROZEN for the 2.4.2c1 release. The freeze will last for around a day, and then we're in a state of mostly-frozen for another week, until 2.4.2 (final). During that week, please don't check things into the

Re: [Python-Dev] IMPORTANT: release24-maint branch is FROZEN from 2005-09-21 00:00 UTC for 2.4.2

2005-09-22 Thread Michael Hudson
Reinhold Birkenfeld [EMAIL PROTECTED] writes: Anthony Baxter wrote: Starting in about 11 hours time, the release24-maint branch is FROZEN for the 2.4.2c1 release. The freeze will last for around a day, and then we're in a state of mostly-frozen for another week, until 2.4.2 (final).

Re: [Python-Dev] GIL, Python 3, and MP vs. UP

2005-09-22 Thread Antoine Pitrou
Hi, On *nix, use a unix domain socket (location in the filesystem which acts as a listening socket). On Windows, you can use cTypes, pywin32, etc., to create a global mutex and/or COM interface. Ok, but for a very simple and crude need like mine (the application code using this IPC means is

Re: [Python-Dev] and and or operators in Py3.0

2005-09-22 Thread Andrew Koenig
In C, C++, C#, Java, and JavaScript, what do you get when you print the result of 3 || 10? In C and C++, you get 1. (in c++ the result is actually true, not 1, but true prints as 1 by default for backward compatibility) ___ Python-Dev mailing list

[Python-Dev] bool(iter([])) changed between 2.3 and 2.4

2005-09-22 Thread Jim Jewett
Greg Ewing wrote: But if the docs don't mention anything about true or false values for some particular type, one tends to assume that all values are true, as is the default for user-defined classes. The tutorials and such stress that python doesn't typically care about a specific True or

Re: [Python-Dev] IMPORTANT: release24-maint branch is FROZEN from 2005-09-21 00:00 UTC for 2.4.2

2005-09-22 Thread Anthony Baxter
On Thursday 22 September 2005 23:36, Jeremy Maxfield wrote: Can the fix for [ 1163563 ] Sub threads execute in restricted mode ( http://sourceforge.net/tracker/index.php?func=detailaid=1163563gr oup_id=5470atid=105470 ) go in before 2.4.2 final? This is a real show stopper for us - we can't

Re: [Python-Dev] IMPORTANT: release24-maint branch is THAWED (partly frozen ; )

2005-09-22 Thread Anthony Baxter
So the 2.4.2c1 release seems to be not a brown-paper-bag release. The branch should be considered ok for those critical fixes that need to go in before 2.4.2 final - please, please, if you're not absolutely sure, ask me first. Anthony -- Anthony Baxter [EMAIL PROTECTED] It's never too

[Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Alexander Myodov
Hello, Don't want to be importunate annoyingly asking the things probably trivial for experienced community, but need to ask it anyway, after spending about two hours trying to find well-camouflaged error caused by it. Why the variables defined inside for/while/if statements (including

Re: [Python-Dev] IMPORTANT: release24-maint branch is FROZEN from 2005-09-21 00:00 UTC for 2.4.2

2005-09-22 Thread Michael Hudson
Anthony Baxter [EMAIL PROTECTED] writes: On Thursday 22 September 2005 23:36, Jeremy Maxfield wrote: Can the fix for [ 1163563 ] Sub threads execute in restricted mode ( http://sourceforge.net/tracker/index.php?func=detailaid=1163563gr oup_id=5470atid=105470 ) go in before 2.4.2 final? This

Re: [Python-Dev] IMPORTANT: release24-maint branch is FROZEN from 2005-09-21 00:00 UTC for 2.4.2

2005-09-22 Thread Jeremy Maxfield
I don't think it's too risky. Michael Hudson did the work and it'sbeen checked into the python CVS for a while. (Python/pystate.c Rev 2.42 and Modules/threadmodule.c Rev 2.64 are required files). We're stuck on Python 2.3.3 because of this bug...(2.4 thread code with thisbug was backported to

Re: [Python-Dev] unintentional and unsafe use of realpath()

2005-09-22 Thread misa
Filed: https://sourceforge.net/tracker/index.php?func=detailaid=1298813group_id=5470atid=305470 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=169046 Misa On Wed, Sep 21, 2005 at 12:04:03PM -0400, Peter Jones wrote: On Wed, 2005-09-14 at 15:25 -0400, Peter Jones wrote: [ comments and a

Re: [Python-Dev] IMPORTANT: release24-maint branch is FROZEN from 2005-09-21 00:00 UTC for 2.4.2

2005-09-22 Thread Jeremy Maxfield
Sorry I think you're 'much mistaken'... The revision of PyState.c in the rc242c1 looks like 2.38.22 (should be 2.42) and threadmodule.clooks like 2.59 (should be 2.64) Cheers, Max On 9/22/05, Michael Hudson [EMAIL PROTECTED] wrote: Anthony Baxter [EMAIL PROTECTED] writes: On Thursday 22

Re: [Python-Dev] bool(iter([])) changed between 2.3 and 2.4

2005-09-22 Thread Guido van Rossum
On 9/22/05, Jim Jewett [EMAIL PROTECTED] wrote: Is there anything left? is a pretty analogy for iterators, But unmaintainable for iterators in general. This was considered ad nauseam when iterators were initially introduced, and it was an explicit decision *not* to provide an API to look ahead.

Re: [Python-Dev] Mapping Darwin 8.2.0 to Mac OS X 10.4.2 in platform.py

2005-09-22 Thread Guido van Rossum
Thanks all! I won't touch it. /usr/bin/sw_vers is the way to go. On 9/22/05, M.-A. Lemburg [EMAIL PROTECTED] wrote: Ronald Oussoren wrote: On 22-sep-2005, at 5:26, Guido van Rossum wrote: The platform module has a way to map system names such as returned by uname() to marketing names.

Re: [Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Josiah Carlson
Alexander Myodov [EMAIL PROTECTED] wrote: Hello, Don't want to be importunate annoyingly asking the things probably trivial for experienced community, but need to ask it anyway, after spending about two hours trying to find well-camouflaged error caused by it. In the future you

Re: [Python-Dev] Adding a conditional expression in Py3.0

2005-09-22 Thread Josiah Carlson
Andrew Koenig [EMAIL PROTECTED] wrote: My problem with this syntax is that it can be hard to read: return if self.arg is None then default else self.arg looks worryingly like return NAME NAME.NAME NAME NAME NAME NAME NAME NAME.NAME to me. Interesting. What about

Re: [Python-Dev] Mapping Darwin 8.2.0 to Mac OS X 10.4.2 in platform.py

2005-09-22 Thread Bob Ippolito
/usr/bin/sw_vers technically calls a private (at least undocumented) CoreFoundation API, it doesn't parse that plist directly :) On further inspection, it looks like parsing the plist directly is supported API these days (see the bottom of http://

Re: [Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Alexander Myodov
Hello Josiah, Why the variables defined inside for/while/if statements (including loop variables for for) are visible outside this scope? JC if and while statements don't define variables, so they can't expose JC them later in the scope. They don't. They just leak internal ones: i = 0 while i

[Python-Dev] GIL, Python 3, and MP vs. UP

2005-09-22 Thread Sokolov Yura
Ok. While windows already prefers threads, while linux-2.6 improves thread support and speed, while process startup expensive on time and memory, while we ought to dublicate our data and/or use obscure shared memory, while it is much simpler to make threaded program with care just about locks

[Python-Dev] vendor-packages directory

2005-09-22 Thread Rich Burridge
Hi, Recently I asked about the inclusion of a vendor-packages directory for Python on the Python mailing list. See the thread started at: http://mail.python.org/pipermail/python-list/2005-September/300029.html for the full reasoning behind this request, and the replies I received. I then

Re: [Python-Dev] Mapping Darwin 8.2.0 to Mac OS X 10.4.2 in platform.py

2005-09-22 Thread Wilfredo Sánchez Vega
Shockingly, it even says that parsing the file is a better way than using gestaltSystemVersion(). It's better for python, anyway, I think, since it doesn't require access to the Carbon API set. Be sure to handle the case where the file doesn't exist: import os

Re: [Python-Dev] IMPORTANT: release24-maint branch is FROZEN from 2005-09-21 00:00 UTC for 2.4.2

2005-09-22 Thread Michael Hudson
Jeremy Maxfield [EMAIL PROTECTED] writes: Sorry I think you're 'much mistaken'... The revision of PyState.c in the rc242c1 looks like 2.38.22 (should be 2.42) and threadmodule.c looks like 2.59 (should be 2.64) Looks like you're right but SF CVS is being *astonishingly* slow right now.

Re: [Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Gareth McCaughan
Alexander Myodov wrote: Thus, your example falls to case 1: i variable is newly declared for this loop. Well, we don't reuse old value of i to start the iteration from a particular place, like below? i = 5 for i in [3,4,5,6,7]: print i, More general, the variables could be assumed

Re: [Python-Dev] GIL, Python 3, and MP vs. UP

2005-09-22 Thread Oleg Broytmann
On Thu, Sep 22, 2005 at 10:27:10AM +0400, Sokolov Yura wrote: MULTIPROCESSING RULES!!! Everything in programming is about divide and conquer. Separate and control. Modules. Classes. Namespaces. And now that multithreading with shared memory. That's an evil idea, it causes a lot of

Re: [Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Terry Reedy
Alexander Myodov [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Why the variables defined inside for/while/if statements (including loop variables for for) are visible outside this scope? Questions about why Python is the way it is belong on comp.lang.python, the general Python

Re: [Python-Dev] GIL, Python 3, and MP vs. UP

2005-09-22 Thread Phillip J. Eby
At 10:27 AM 9/22/2005 +0400, Sokolov Yura wrote: It is so simple to write application server in Python. It is so difficult to make it scallable in CPython. It seems you've never heard of fork(), which works just fine to scale Python processes on multiprocessor boxes. I've actually done this,

Re: [Python-Dev] vendor-packages directory

2005-09-22 Thread Phillip J. Eby
At 08:19 AM 9/22/2005 -0700, Rich Burridge wrote: Hi, Recently I asked about the inclusion of a vendor-packages directory for Python on the Python mailing list. See the thread started at: http://mail.python.org/pipermail/python-list/2005-September/300029.html for the full reasoning behind

Re: [Python-Dev] GIL, Python 3, and MP vs. UP

2005-09-22 Thread Fredrik Lundh
Phillip J. Eby wrote: It is so simple to write application server in Python. It is so difficult to make it scallable in CPython. It seems you've never heard of fork(), which works just fine to scale Python processes on multiprocessor boxes. there's a version of fork hidden somewhere in

Re: [Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Josiah Carlson
Alexander Myodov [EMAIL PROTECTED] wrote: [snip Alexander Myodov complaining about how Python works] i = 0 while i != 1: i += 1 j = 5 print j Maybe you don't realize this, but C's while also 'leaks' internal variables... int i = 0, j; while (i != 1) { i++; j = 5; }

[Python-Dev] Compressing MSI files: 2.4.2 candidate?

2005-09-22 Thread Martin v. Löwis
I just found that I can save somewhat more than 1MiB in the MSI file by using LZX:21 instead of the standard MSZIP when compressing the CAB file. A resulting package can be found at http://www.dcl.hpi.uni-potsdam.de/home/loewis/python-2.4.2c1.msi Can people please test whether this installs just

Re: [Python-Dev] vendor-packages directory

2005-09-22 Thread Rich Burridge
Phillip J. Eby wrote: Recently I asked about the inclusion of a vendor-packages directory for Python on the Python mailing list. See the thread started at: http://mail.python.org/pipermail/python-list/2005-September/300029.html for the full reasoning behind this request, and the

Re: [Python-Dev] vendor-packages directory

2005-09-22 Thread Phillip J. Eby
At 12:04 PM 9/22/2005 -0700, Rich Burridge wrote: Phillip J. Eby wrote: Recently I asked about the inclusion of a vendor-packages directory for Python on the Python mailing list. See the thread started at: http://mail.python.org/pipermail/python-list/2005-September/300029.html for the full

Re: [Python-Dev] GIL, Python 3, and MP vs. UP

2005-09-22 Thread Phillip J. Eby
At 08:42 PM 9/22/2005 +0200, Fredrik Lundh wrote: Phillip J. Eby wrote: At 10:27 AM 9/22/2005 +0400, Sokolov Yura wrote: It is so simple to write application server in Python. It is so difficult to make it scallable in CPython. It seems you've never heard of fork(), which works just fine to

Re: [Python-Dev] vendor-packages directory

2005-09-22 Thread Bob Ippolito
On Sep 22, 2005, at 3:56 PM, Phillip J. Eby wrote: At 12:04 PM 9/22/2005 -0700, Rich Burridge wrote: Phillip J. Eby wrote: Recently I asked about the inclusion of a vendor-packages directory for Python on the Python mailing list. See the thread started at:

Re: [Python-Dev] vendor-packages directory

2005-09-22 Thread Bob Ippolito
On Sep 22, 2005, at 3:04 PM, Rich Burridge wrote: Phillip J. Eby wrote: Recently I asked about the inclusion of a vendor-packages directory for Python on the Python mailing list. See the thread started at: http://mail.python.org/pipermail/python-list/2005-September/ 300029.html for

Re: [Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Alexander Myodov
Hello Josiah, i = 0 while i != 1: i += 1 j = 5 print j JC Maybe you don't realize this, but C's while also 'leaks' internal JC variables... JC int i = 0, j; JC while (i != 1) { JC i++; JC j = 5; JC } JC printf(%i %i\n, i, j); Yeah, it may *leak* it in your example. But the

Re: [Python-Dev] vendor-packages directory

2005-09-22 Thread Phillip J. Eby
At 01:18 PM 9/22/2005 -0700, Rich Burridge wrote: Phillip J. Eby wrote: Right - I'm proposing you add a vendor-packages.pth file to site-pacakges, that points to a totally separate base directory where those files are installed, not that you install the packages themselves under site-packages.

Re: [Python-Dev] os.path.diff(path1, path2) (and a first post)

2005-09-22 Thread richard barran
On Sat, 17 Sep 2005, John J Lee wrote: On Fri, 16 Sep 2005, Greg Ewing wrote: Trent Mick wrote: If this *does* get added (I'm +0) then let's call it relpath or relpathto as in the various implementations out there: +1 on that, too. Preferably just relpath. [...] +1

Re: [Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Josiah Carlson
Alexander Myodov [EMAIL PROTECTED] wrote: for (int i = 0; i 10; i++) works fine nowadays. JC I'm sorry, but you are wrong. The C99 spec states that you must define JC the type of i before using it in the loop. Maybe you are thinking of JC C++, which allows such things. gcc -std=c99

Re: [Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Guido van Rossum
Please end this thread. It belongs in c.l.py. Nothing's going to change. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] GIL, Python 3, and MP vs. UP

2005-09-22 Thread Bill Janssen
Sokolov Jura writes: It is so simple to write application server in Python. It is so difficult to make it scallable in CPython. CPython will not be wide popular without real multithreading. He's right. Bill ___ Python-Dev mailing list

Re: [Python-Dev] GIL, Python 3, and MP vs. UP

2005-09-22 Thread Terry Reedy
Bill Janssen [EMAIL PROTECTED] wrote in message news:05Sep22.141518pdt.58617@synergy1.parc.xerox.com... Sokolov Jura writes: It is so simple to write application server in Python. It is so difficult to make it scallable in CPython. CPython will not be wide popular without real

Re: [Python-Dev] os.path.diff(path1, path2) (and a first post)

2005-09-22 Thread Trent Mick
[richard barran wrote] So I have a question: do the previous mails mean that a relpath function might possibly be a usefull addition to os.path? Yes, it seems to have support. And if the answer to the previous question is yes, then should I submit a patch, or is someone else already

Re: [Python-Dev] os.path.diff(path1, path2) (and a first post)

2005-09-22 Thread Bob Ippolito
On Sep 22, 2005, at 8:58 PM, Trent Mick wrote: [richard barran wrote] So I have a question: do the previous mails mean that a relpath function might possibly be a usefull addition to os.path? Yes, it seems to have support. I'd like to throw in another late +1 here, I've written this

Re: [Python-Dev] bool(iter([])) changed between 2.3 and 2.4

2005-09-22 Thread Greg Ewing
Jim Jewett wrote: Is there anything left? is a pretty analogy for iterators, particularly since the examples tend to start with list or file iterators. But this can't be supported by all iterators, so it would be something special to these iterators. Keeping track of the peculiarities of

Re: [Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Greg Ewing
Josiah Carlson wrote: As for list comprehensions, they were literally meant to be a completely equivalent translation of a set of for loops. I don't think that's quite true. I doubt whether anyone really thought about the issue when LCs were first being discussed. I didn't, but if I had, I

Re: [Python-Dev] Visibility scope for for/while/if statements

2005-09-22 Thread Guido van Rossum
On 9/22/05, Greg Ewing [EMAIL PROTECTED] wrote: Josiah Carlson wrote: As for list comprehensions, they were literally meant to be a completely equivalent translation of a set of for loops. I don't think that's quite true. I doubt whether anyone really thought about the issue when LCs were