Re: [Python-Dev] Terminology for PEP 343

2005-07-05 Thread Greg Ewing
Phillip J. Eby wrote: At 11:48 PM 7/3/2005 -0400, Raymond Hettinger wrote: with context_expression as variable: # perform actions within a context The with statement establishes a context in which some operations are to be performed. I like this. The object produced by

Re: [Python-Dev] Terminology for PEP 343

2005-07-05 Thread Nick Coghlan
Raymond Hettinger wrote: With Statements and Suite Management This is nicely done :-) Nit: Replace e.g. with such as. BTW, do you support changing __exit__ to __leave__? I think it provides a small but useful gain in usability. I was initially -0 on the idea, and I've moved to a

Re: [Python-Dev] Terminology for PEP 343

2005-07-05 Thread Fred L. Drake, Jr.
On Tuesday 05 July 2005 02:57, Greg Ewing wrote: I'm thinking about something like context manager, or at least something with context in it. Oh, I like this one. Context manager / context protocol work well for me. -Fred -- Fred L. Drake, Jr. fdrake at acm.org

[Python-Dev] getch() in msvcrt does not accept extended characters.

2005-07-05 Thread Darryl Dixon
Hi, I'm sorry, I don't seem to have done a very good job at explaining the situation. I'll try again: 'getch()' is a low-level function provided on Windows to capture a single character of input from a user, /without echoing it to the screen/. As far as I can tell there's no other way of

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

2005-07-05 Thread Arthur
* and because Guido believes beginners tend to copy too much (that is one reason why copy.copy is not a builtin) and that the language should encourage correct behavior. OTOH, beginners tend to copy not enough - when for example iterating over a list being acting upon. Though my real

Re: [Python-Dev] getch() in msvcrt does not accept extended characters.

2005-07-05 Thread Jeff Epler
Whatever it is that you need 'getch' to do, can't you incorporate it first in an extension module you bundle with your application or library, rather than using the (broken?) wrapper in the msvcrt module? Jeff pgpArc0XfxgA7.pgp Description: PGP signature

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

2005-07-05 Thread Martin v. Löwis
Aahz wrote: I was trying to compile a python plugin (for gimp) using the MSYS shell and the MINGW compiler. python-dev is the wrong place for this question Actually, it isn't - he is really asking what the best way of porting Python to MSYS is. Regards, Martin

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

2005-07-05 Thread Martin v. Löwis
lode leroy wrote: maybe someone could extend os.path to do this in the standard distribution: implement an msyspath.py, which calls ntpath for each function, and does a replace at the end of the evaluation. The chances are good that nobody else will work on this - so it is likely that it is

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

2005-07-05 Thread Martin v. Löwis
Gary Robinson wrote: #include Python.h static double gfSumChiSquare = 123.0; static PyObject * getSumChiSquare(PyObject *self, PyObject *args){ return Py_BuildValue(d, gfSumChiSquare); } static PyMethodDef SimMethods[] = { {getSumChiSquare,

Re: [Python-Dev] getch() in msvcrt does not accept extended characters.

2005-07-05 Thread Darryl Dixon
Sorry all, It seems that the list mods have finally released a duplicate message that I wrote last week when I wasn't subscribed to the list. Please ignore the message below if you have read the previous copy already. D On Thu, 2005-06-30 at 09:43 +1200, Darryl Dixon wrote: Hi, I'm

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

2005-07-05 Thread Aahz
On Tue, Jul 05, 2005, Martin v. L?wis wrote: Aahz wrote: Martin removed the attribution here: I was trying to compile a python plugin (for gimp) using the MSYS shell and the MINGW compiler. python-dev is the wrong place for this question Actually, it isn't - he is really asking what the

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

2005-07-05 Thread Martin v. Löwis
Aahz wrote: Hrm. I thought we told people to start with comp.lang.python for porting questions, but I'm happy to be corrected. I'm unaware of such a policy, but I may have missed the relevant discussion. I could understand that questions of the kind I tried to build Python on X, and the

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

2005-07-05 Thread Greg Ewing
Arthur wrote: If the thought is that hiding copy, or relying on idioms for a construct as fundamental as the list - is a favor to the beginner, I very much am not. I don't think anyone believes that. It's more a feeling that Python shouldn't be cluttered up with things that are *only* for

[Python-Dev] Weekly Python Patch/Bug Summary

2005-07-05 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 348 open ( +4) / 2879 closed ( +4) / 3227 total ( +8) Bugs: 898 open ( +1) / 5103 closed ( +9) / 6001 total (+10) RFE : 193 open ( +2) / 170 closed ( +0) / 363 total ( +2) New / Reopened Patches __

[Python-Dev] Triple-quoted strings and indentation

2005-07-05 Thread Andrew Durdin
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, particularly when they're nested within a block or two -- it's a wart: try:

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

2005-07-05 Thread Steven Bethard
On 7/5/05, Andrew Durdin [EMAIL PROTECTED] wrote: print Usage: dostuff options Options: -c - blah blah -f filename - do stuff with file filename -s - more blah Isn't the standard idiom for this already: import textwrap ... print textwrap.dedent(\ Usage:

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

2005-07-05 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,