Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Thomas Lotze
Guido van Rossum [EMAIL PROTECTED] wrote: I also notice that your only example is very repetitive, and would be better written as a loop, using Python's dynamic nature: Sure, that's true for the example given. Getting other stuff into a form which allows for looping may require additional

[Python-Dev] PEP 343 documentation on Sourceforge Patch tracker

2005-07-07 Thread Nick Coghlan
I've put the draft documentation on the SF tracker, as Patch ID #1234057 [1]. The version posted there has a few changes from the last draft I mailed to the list, including: - mention try/finally, then describe with statements as a way to eliminate the associated boilerplate - clean up some

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-07-07 Thread Thomas Heller
Neil Hodgson [EMAIL PROTECTED] writes: Guido van Rossum: Ah, sigh. I didn't know that os.listdir() behaves differently when the argument is Unicode. Does os.listdir(.) really behave differently than os.listdir(u.)? Yes: os.listdir(.) ['abc', ''] os.listdir(u.) [u'abc',

[Python-Dev] C bindings calling tmpfile() blocks interrupt signal

2005-07-07 Thread Florent Pillet
I discovered an issue on Mac OS X that seems to relate to signal handling. I have a C binding in which I call the standard tmpfile() function. After calling it, I can't break Python anymore with CTRL-C. Investigating the Darwin source code for tmpfile() (and FreeBSD, they are the same) , I found

Re: [Python-Dev] 'With' context documentation draft (was Re: Terminology for PEP 343

2005-07-07 Thread Michael Hudson
Barry Warsaw [EMAIL PROTECTED] writes: +1 on @contextmanager On Wed, 2005-07-06 at 19:47, Raymond Hettinger wrote: __enter__(self): __exit__(self, exc_type, exc_value, exc_traceback): These names should be changed to __beginwith__ and __endwith__. -1. -0. My fingers are

[Python-Dev] Linux Python linking with G++?

2005-07-07 Thread David Abrahams
Apparently Python on some linux distros is being linked by g++ rather than gcc, resulting in the C++ runtime library being linked into Python; this has bad consequences for compatibility between C++ extension modules and Pythons that have been built with different versions of GCC. Is this

Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread Sjoerd Mullender
David Abrahams wrote: Apparently Python on some linux distros is being linked by g++ rather than gcc, resulting in the C++ runtime library being linked into Python; this has bad consequences for compatibility between C++ extension modules and Pythons that have been built with different

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Guido van Rossum
On 7/7/05, Thomas Lotze [EMAIL PROTECTED] wrote: Sure, that's true for the example given. Getting other stuff into a form which allows for looping may require additional code. Well, hypothetical illustrations don't carry much value when arguing for something as substantial as new syntax

Re: [Python-Dev] List copy and clear (was Re: Inconsistent API forsets.Set and build-in set)

2005-07-07 Thread Christos Georgiou
Tim Peters [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Or my personal favorite, while mylist: del mylist[::2] Then the original index positions with the most consecutive trailing 1 bits survive the longest, which is important to avoid ZODB cache bugs wink. This

Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread David Abrahams
Sjoerd Mullender [EMAIL PROTECTED] writes: David Abrahams wrote: Apparently Python on some linux distros is being linked by g++ rather than gcc, resulting in the C++ runtime library being linked into Python; this has bad consequences for compatibility between C++ extension modules and

Re: [Python-Dev] List copy and clear (was Re: Inconsistent API forsets.Set and build-in set)

2005-07-07 Thread Tim Peters
[Tim Peters] Or my personal favorite, while mylist: del mylist[::2] Then the original index positions with the most consecutive trailing 1 bits survive the longest, which is important to avoid ZODB cache bugs wink. [Christos Georgiou] This is a joke, hopefully, and in that

Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread Skip Montanaro
Configure with --without-cxx to not use g++. Since there is an option in configure, I assume it is intentional. Dave O-kay... any idea what the rationale for this decision might be? I believe it's so that people can link in libraries written in C++ and have them initialized

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread François Pinard
[Guido van Rossum] I even wonder if else-clauses on for/while were a good idea. I surely find them useful, and see them as a Python originality (a welcome one). -- François Pinard http://pinard.progiciels-bpi.ca ___ Python-Dev mailing list

Re: [Python-Dev] 'With' context documentation draft (was Re: Terminology for PEP 343

2005-07-07 Thread Guido van Rossum
+1 on @contextmanager +1. [__enter__, __exit__] These names should be changed to __beginwith__ and __endwith__. -1. The PEP has had an extensive review period and several alternatives were discussed and rejected. These names are clear, they *do* match, and as Fred says the __*__ namespace

Re: [Python-Dev] 'With' context documentation draft (was Re: Terminology for PEP 343

2005-07-07 Thread Phillip J. Eby
At 09:12 PM 7/6/2005 +1000, Nick Coghlan wrote: Another example is the use of contexts to handle insertion of the appropriate tags when generating HTML: with html: with body: with h1: print Some heading with p: print This is paragraph

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Josiah Carlson
Guido van Rossum [EMAIL PROTECTED] wrote: On 7/7/05, François Pinard [EMAIL PROTECTED] wrote: [Guido van Rossum] I even wonder if else-clauses on for/while were a good idea. I surely find them useful, and see them as a Python originality (a welcome one). They are indeed an

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Tim Peters
[Guido, on {for,while}/else] ... The question remains whether Python would be easier to learn without them. And if so, the question would remain whether that's offset by their utility for experienced developers. All hard to assess impartially! That's what I'm here for. I like loop else

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Guido van Rossum
[Guido, on {for,while}/else] ... The question remains whether Python would be easier to learn without them. And if so, the question would remain whether that's offset by their utility for experienced developers. All hard to assess impartially! [Tim saves the day] That's what I'm here

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread David Abrahams
Tim Peters [EMAIL PROTECTED] writes: I also suspect that if they weren't in the language already, a PEP to introduce them would fail, because still_looking = True some loop: if found it: still_looking = False break if still_looking: #

Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread David Abrahams
Skip Montanaro [EMAIL PROTECTED] writes: Configure with --without-cxx to not use g++. Since there is an option in configure, I assume it is intentional. Dave O-kay... any idea what the rationale for this decision might be? I believe it's so that people can link in libraries

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Phillip J. Eby
At 02:48 PM 7/7/2005 -0400, Tim Peters wrote: [Guido, on {for,while}/else] ... The question remains whether Python would be easier to learn without them. And if so, the question would remain whether that's offset by their utility for experienced developers. All hard to assess impartially!

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Aahz
On Thu, Jul 07, 2005, Guido van Rossum wrote: OTOH I don't particularly like code that requires flag variables; they often make me squirm because the same condition (flag) is tested multiple times where it could be tested just once if more sophisticated flow control (e.g. an else clause :)

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread François Pinard
[Guido van Rossum] On 7/7/05, François Pinard [EMAIL PROTECTED] wrote: [Guido van Rossum] I even wonder if else-clauses on for/while were a good idea. I surely find them useful, and see them as a Python originality (a welcome one). The question remains whether Python would be easier

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Tim Peters
[Guido] OTOH I don't particularly like code that requires flag variables; Me neither; that's indeed why this one isn't a slam dunk. they often make me squirm because the same condition (flag) is tested multiple times where it could be tested just once if more sophisticated flow control (e.g.

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Barry Warsaw
On Thu, 2005-07-07 at 14:54, Guido van Rossum wrote: How would a PEP to *remove* this feature fare today? Not well, I hope, although I suppose everything's up for debate in Py3K. Yes, they're rarely used and there is an alternative, but I do find them useful and succinct when they're needed.

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread François Pinard
[Josiah Carlson] [Guido van Rossum] I even wonder if else-clauses on for/while were a good idea. I had gotten along for 5 years without knowing/remembering there existed an else clause [...] Just throwing a few more cents in. I have been programming (rather successfully) for a few

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Tim Peters
[Jeremy Hylton] ... PS Every time I switch between Python and C, I get confused about elif and else if. Mostly goes to show that you don't use Perl much ;-) Of course, in C99, #define elif else if is part of stdlib.h. Or maybe it isn't, and it just should have been? One of those -- or

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Brett Cannon
On 7/7/05, Tim Peters [EMAIL PROTECTED] wrote: [Guido] OTOH I don't particularly like code that requires flag variables; Me neither; that's indeed why this one isn't a slam dunk. they often make me squirm because the same condition (flag) is tested multiple times where it could be

[Python-Dev] Another SoC student for CVS access

2005-07-07 Thread Brett Cannon
Floris is working on wrapping Hotshot to replace 'profile' and replacing pstats so that there will be no more need for 'profile' and thus take care of the licensing problem. He also hopes to make pstats faster to use. And if we are really lucky, get threading working for Hotshot. It would be

Re: [Python-Dev] Another SoC student for CVS access

2005-07-07 Thread Jeremy Hylton
On 7/7/05, Brett Cannon [EMAIL PROTECTED] wrote: Floris is working on wrapping Hotshot to replace 'profile' and replacing pstats so that there will be no more need for 'profile' and thus take care of the licensing problem. He also hopes to make pstats faster to use. And if we are really

Re: [Python-Dev] 'With' context documentation draft (was Re: Terminology for PEP 343

2005-07-07 Thread Walter Dörwald
Am 07.07.2005 um 20:00 schrieb Guido van Rossum: +1 on @contextmanager +1. [__enter__, __exit__] These names should be changed to __beginwith__ and __endwith__. -1. The PEP has had an extensive review period and several alternatives were discussed and rejected. These names are clear,

Re: [Python-Dev] GCC version compatibility

2005-07-07 Thread Martin v. Löwis
David Abrahams wrote: I'm wondering if there has been a well-known recent change either in Python or GCC that would account for these new reports. Any relevant information would be appreciated. So what about the theory that it may be that different versions of libstdc++ get linked? Python is

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Gustavo Niemeyer
How would a PEP to *remove* this feature fare today? I hope not well, since I use them quite often. Barry also reiterated this idea and I support removing them in Python 3000. I do use them when I want to know when I break out of a loop prematurely, but I am definitely not a typical use

Re: [Python-Dev] GCC version compatibility

2005-07-07 Thread David Abrahams
Martin v. Löwis [EMAIL PROTECTED] writes: David Abrahams wrote: I'm wondering if there has been a well-known recent change either in Python or GCC that would account for these new reports. Any relevant information would be appreciated. So what about the theory that it may be that different

Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread David Abrahams
Skip Montanaro [EMAIL PROTECTED] writes: I believe it's so that people can link in libraries written in C++ and have them initialized properly. Dave Can you give specifics? What do you mean by link in? Do you Dave mean statically link into the Python interpreter, or

Re: [Python-Dev] Another SoC student for CVS access

2005-07-07 Thread Brett Cannon
On 7/7/05, Jeremy Hylton [EMAIL PROTECTED] wrote: On 7/7/05, Brett Cannon [EMAIL PROTECTED] wrote: Floris is working on wrapping Hotshot to replace 'profile' and replacing pstats so that there will be no more need for 'profile' and thus take care of the licensing problem. He also hopes to

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Jack Diederich
On Thu, Jul 07, 2005 at 03:03:35PM -0400, Phillip J. Eby wrote: At 02:48 PM 7/7/2005 -0400, Tim Peters wrote: [Guido, on {for,while}/else] ... The question remains whether Python would be easier to learn without them. And if so, the question would remain whether that's offset by their

Re: [Python-Dev] Another SoC student for CVS access

2005-07-07 Thread Barry Warsaw
On Thu, 2005-07-07 at 16:30, Brett Cannon wrote: Floris is working on wrapping Hotshot to replace 'profile' and replacing pstats so that there will be no more need for 'profile' and thus take care of the licensing problem. He also hopes to make pstats faster to use. And if we are really

Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread David Abrahams
Martin v. Löwis [EMAIL PROTECTED] writes: David Abrahams wrote: Apparently Python on some linux distros is being linked by g++ rather than gcc, resulting in the C++ runtime library being linked into Python; this has bad consequences for compatibility between C++ extension modules and Pythons

Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread David Abrahams
Jeff Epler [EMAIL PROTECTED] writes: If we change the linker back to gcc, not g++, will it work if extension module 1 gets linked with libstdc++ A and ABI Q, and extension module 2 gets linked with libstdc++ B and ABI Z? Yes, unless they are using sys.setdlopenflags to force symbols to be

[Python-Dev] checklist for filing a bug

2005-07-07 Thread Brett Cannon
In order to lower the barrier for reporting bugs, writing patches, and handling CVS commits, I am writing up checklists for each and I will put them up on python.org. The first checklist is for bug reports. All comments welcome. Keep in mind the list is supposed to be short and

Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread Martin v. Löwis
Jeff Epler wrote: If we change the linker back to gcc, not g++, will it work if extension module 1 gets linked with libstdc++ A and ABI Q, and extension module 2 gets linked with libstdc++ B and ABI Z? The problem is that it won't link at all. Compiling Modules/ccpython.o using g++ creates (in