Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-06 Thread Terry Reedy
Andrew Durdin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In general, I find triple-quoted strings to be very handy, particularly for standalone scripts. However, the fact that they have to be written in the left-hand column to avoid leading whitespace really grates,

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-06 Thread Andrew Durdin
On 7/6/05, Terry Reedy [EMAIL PROTECTED] wrote: Doc strings, first meant for the code reader, need to be where they are. They also come before the code itself, so don't interfere. Doc strings are really not an issue, due to the conventions for processing whitespace in them (and also the fact

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-06 Thread Andrew Durdin
Here's the draft PEP I wrote up: Abstract Triple-quoted string (TQS henceforth) literals in Python preserve the formatting of the literal string including newlines and whitespace. When a programmer desires no leading whitespace for the lines in a TQS, he must align all lines

Re: [Python-Dev] Terminology for PEP 343

2005-07-06 Thread Nick Coghlan
Michael Sparks wrote: On Monday 04 Jul 2005 03:10, Phillip J. Eby wrote: At 03:41 PM 7/3/2005 -0400, Raymond Hettinger wrote: [Michael Hudson] This is possible. I just wanted to expand everyone's minds :) The mechanism is more general than resourcemanagement. Expand your mind. :)

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

2005-07-06 Thread Neil Hodgson
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] 'With' context documentation draft (was Re: Terminology for PEP 343

2005-07-06 Thread Nick Coghlan
OK, here's some draft documentation using Phillip's context terminology. I think it works very well. With Statements and Context Management A frequent need in programming is to ensure a particular action is taken after a specific section of code has been executed (such as closing a file or

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

2005-07-06 Thread Paul Moore
On 7/6/05, Nick Coghlan [EMAIL PROTECTED] wrote: OK, here's some draft documentation using Phillip's context terminology. I think it works very well. I agree. +1 on this terminology, and for this explanation to be included in the docs. I also like the fact that it offers a neat 1-word name for

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

2005-07-06 Thread Michael Chermside
Nick writes sample documentation: For example, the following context manager allows prompt closure of any resource with a 'close' method (e.g. a generator or file): @context def closing(resource): try: yield resource finally:

Re: [Python-Dev] Possible C API problem?

2005-07-06 Thread Michael Hudson
Martin v. Löwis [EMAIL PROTECTED] writes: Gary Robinson wrote: Are the docs wrong or am I misreading them? Or are you wrong? It turns out that I am wrong. This is a long standing confusion. At one point, the documentation said what you said, and it was just as wrong. There were even

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

2005-07-06 Thread Nick Coghlan
Paul Moore wrote: On 7/6/05, Nick Coghlan [EMAIL PROTECTED] wrote: OK, here's some draft documentation using Phillip's context terminology. I think it works very well. I agree. +1 on this terminology, and for this explanation to be included in the docs. I also like the fact that it

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

2005-07-06 Thread Paul Moore
On 7/6/05, Michael Chermside [EMAIL PROTECTED] wrote: Paul Moore writes: I also like the fact that it offers a neat 1-word name for the generator decorator, @context. Well, ok... does anyone *else* agree? I too saw this and thought neat! a simple one-word name!. But then I started

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

2005-07-06 Thread Reinhold Birkenfeld
Paul Moore wrote: On 7/6/05, Michael Chermside [EMAIL PROTECTED] wrote: Paul Moore writes: I also like the fact that it offers a neat 1-word name for the generator decorator, @context. Well, ok... does anyone *else* agree? I too saw this and thought neat! a simple one-word name!. But

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-06 Thread Guido van Rossum
On 7/5/05, Andrew Durdin [EMAIL PROTECTED] wrote: I have written a patch that changes the way triple-quoted strings are scanned so that leading whitespace is ignored in much the same way that pep 257 handles it for docstrings. Largely this was for a learning experience in hacking the parser,

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

2005-07-06 Thread Guido van Rossum
On 7/6/05, Thomas Lotze [EMAIL PROTECTED] wrote: I want to ask what you think about introducing a keyword 'eltry' which would be the counterpart of 'elif' for try statements. This had been suggested before on python-list a couple of years ago by Jonathan Gardner, but nothing (that I could

Re: [Python-Dev] using pyhon from the MSYS shell

2005-07-06 Thread lode leroy
From: Martin v. Löwis [EMAIL PROTECTED] I'm personally in favour of supporting MSYS as a target system. If you want to do it, I'm willing to review patches, but I'm not willing to do them myself, as I don't use MSYS. If you believe that MSYS is a target system in a way similar to mingw32, and to

Re: [Python-Dev] Expanding max chunk size to 4GB.

2005-07-06 Thread Guido van Rossum
Looks ok to me, but have you tested this with other software that reads/writes wave files? You seem to be speculating about the format where you should be reading the reference documentation for this file format (alas, I can't help you find it -- you can Google for it as well as I can :). Also,

[Python-Dev] Request to add developer

2005-07-06 Thread A.M. Kuchling
I wish to request that 'gregorykjohnson' be added to the Python SF project. Gregory is the participant I'm mentoring in Google's Summer of Code program. His project is enhancing mailbox.py to give it the ability to modify mailboxes as well as read them; see

Re: [Python-Dev] Request to add developer

2005-07-06 Thread Raymond Hettinger
I wish to request that 'gregorykjohnson' be added to the Python SF project. I'll enable the permissions tonight. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

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

2005-07-06 Thread Raymond Hettinger
[Thomas Lotze] I want to ask what you think about introducing a keyword 'eltry' which would be the counterpart of 'elif' for try statements. This had been suggested before on python-list a couple of years ago by Jonathan Gardner, but nothing (that I could find) seems to have come of

Re: [Python-Dev] Expanding max chunk size to 4GB.

2005-07-06 Thread Mark Rages
On 7/6/05, Guido van Rossum [EMAIL PROTECTED] wrote: Looks ok to me, but have you tested this with other software that reads/writes wave files? It appears to work, but I haven't done enough testing to be confident. You seem to be speculating about the format where you should be reading the

Re: [Python-Dev] Expanding max chunk size to 4GB.

2005-07-06 Thread Erik de Castro Lopo
Mark Rages wrote: The RIFF chunk size (used by the Python wave library) is 2GB, because the length is read as a signed 32-bit integer. The attached patch to chunk.py raises the limit to 4GB by using a signed integer. Is this correct? The original Microsoft specification listed the chunk

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

2005-07-06 Thread Delaney, Timothy (Tim)
Well, I'm convinced. My votes go to context management protocol and @contextmanager. Simple, descriptive and specific in meaning yet wide enough to cover pretty much all the cases we care about. I think we should state in the docs that the most common usage is to set up a specific context and

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

2005-07-06 Thread Raymond Hettinger
[Nick Coghlan] OK, here's some draft documentation using Phillip's context terminology. I think it works very well. With Statements and Context Management A frequent need in programming is to ensure a particular action is taken after a specific section of code has been executed (such as

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

2005-07-06 Thread Delaney, Timothy (Tim)
Raymond Hettinger wrote: These names should be changed to __beginwith__ and __endwith__. The Alternatively: __begincontext__ / __endcontext__ __enterwith__ / __exitwith__ __entercontext__ / __exitcontext__ __begin_with__ / __end_with__ __begin_context__ / __end_context__ __enter_with__ /

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

2005-07-06 Thread Nicolas Fleury
Fred L. Drake, Jr. wrote: On Wednesday 06 July 2005 19:47, Raymond Hettinger wrote: These names should be changed to __beginwith__ and __endwith__. The current names are too vague, not obviously paired with each other, not obviously tied to the with-statement, and provide no hint about

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

2005-07-06 Thread Barry Warsaw
+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__. -0. My fingers are too hardwired to writing endswith, as in the

[Python-Dev] GCC version compatibility

2005-07-06 Thread David Abrahams
Recently people testing Boost.Python with GCC on Linux have reported that the extensions being tested have to be compiled with exactly the same version of GCC as the Python they're being loaded into, or they get mysterious crashes. That doesn't correspond to my past experience; it has always