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

2005-07-08 Thread Guido van Rossum
On 7/7/05, Walter Dörwald [EMAIL PROTECTED] wrote: What is still unspecified (or at least not explicitely mentioned) in the PEP is the lifetime of VAR in: with EXPR as VAR: BLOCK It is specified well enough IMO -- you're supposed to take the translation into basic

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

2005-07-08 Thread Walter Dörwald
Guido van Rossum wrote: On 7/7/05, Walter Dörwald [EMAIL PROTECTED] wrote: What is still unspecified (or at least not explicitely mentioned) in the PEP is the lifetime of VAR in: with EXPR as VAR: BLOCK It is specified well enough IMO -- you're supposed to take the

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

2005-07-08 Thread Michael Hudson
Walter Dörwald [EMAIL PROTECTED] writes: 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

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

2005-07-08 Thread Walter Dörwald
Michael Hudson wrote: Walter Dörwald [EMAIL PROTECTED] writes: [...] I.e. will VAR still exist after the end of the block with its value the return value of __enter__() or will it revert to the previous value (if any)? Eh, no. Where would you store the old value? I don't know, where does:

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

2005-07-08 Thread Michael Hudson
Ron Adam [EMAIL PROTECTED] writes: Guido van Rossum wrote: I even wonder if else-clauses on for/while were a good idea. (The one on try is definitely a good idea since the use case is quite frequent and only clumsily handled otherwise; the use cases for else on for/while are less convincing

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

2005-07-08 Thread Neil Hodgson
Thomas Heller: OTOH, I once had a bug report from a py2exe user who complained that the program didn't start when installed in a path with japanese characters on it. I tried this out, the bug existed (and still exists), but I was astonished how many programs behaved the same: On a PC with

Re: [Python-Dev] checklist for filing a bug

2005-07-08 Thread Skip Montanaro
Brett #. Gather important information Brett Info such as Python version, operating system version, etc.; Brett anything that might have influenced the code that lead to the Brett bug. I'd change this to something more explicit: # Gather important information

Re: [Python-Dev] GCC version compatibility

2005-07-08 Thread David Abrahams
[Christoph, please keep the python-dev list in the loop here, at least until they get annoyed and decide we're off-topic. I think this is crucial to the way they package and deliver Python] Christoph Ludwig [EMAIL PROTECTED] writes: On Thu, Jul 07, 2005 at 06:27:46PM -0400, David Abrahams

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

2005-07-08 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: ... if Py3k ever happens, I'd hope that it would be the *one* Python to use -- too many incompatibilities would probably mean *two* Pythons fighting each other). A caduceus to heal software problems? http://www.pantheon.org/articles/c/caduceus.html --Scott David

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

2005-07-08 Thread Ron Adam
Michael Hudson wrote: Ron Adam [EMAIL PROTECTED] writes: Guido van Rossum wrote: I even wonder if else-clauses on for/while were a good idea. (The one on try is definitely a good idea since the use case is quite frequent and only clumsily handled otherwise; the use cases for else on

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

2005-07-08 Thread Ron Adam
Thomas Lotze wrote: Ron Adam [EMAIL PROTECTED] wrote: 3. In a while loop, it's a value test, where the else block gets executed if the while condition evaluates as false, the while block may or may not execute. You still need a flag to test for that. You're effectively arguing for

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

2005-07-08 Thread Terry Reedy
Nick Coghlan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Phillip J. Eby wrote: I suggest changing this to something like this: class tag(object): def __init__(self,name): self.name = name def __enter__(self): print %s % name

[Python-Dev] Possible context managers in stdlib

2005-07-08 Thread Reinhold Birkenfeld
Hi, I compiled a list of some possible new context managers that could be added to the stdlib. Introducing a new feature should IMO also show usage of it in the distribution itself. That wasn't done with decorators (a decorators module is compiled at the moment, if I'm right), but with context

Re: [Python-Dev] Possible context managers in stdlib

2005-07-08 Thread Brett Cannon
On 7/8/05, Reinhold Birkenfeld [EMAIL PROTECTED] wrote: Hi, I compiled a list of some possible new context managers that could be added to the stdlib. Introducing a new feature should IMO also show usage of it in the distribution itself. That wasn't done with decorators (a decorators module

Re: [Python-Dev] checklist for filing a bug

2005-07-08 Thread Raymond Hettinger
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. -0 on the checklists. I don't think existing barriers are high at all. The entries may be variously regarded as codifying

Re: [Python-Dev] Possible context managers in stdlib

2005-07-08 Thread James Y Knight
On Jul 8, 2005, at 4:46 PM, Brett Cannon wrote: I think having basic context managers in a stdlib module that we know for a fact that will be handy is a good idea. We should keep the list short and poignant, but we should have something for people to work off of. The ones I like below for a

Re: [Python-Dev] Possible context managers in stdlib

2005-07-08 Thread Barry Warsaw
On Fri, 2005-07-08 at 16:24, Reinhold Birkenfeld wrote: I compiled a list of some possible new context managers that could be added to the stdlib. I agree with Brett and Phillip that a few well-chosen context managers would make sense in the stdlib both for convenience and for example

Re: [Python-Dev] Possible context managers in stdlib

2005-07-08 Thread Reinhold Birkenfeld
Phillip J. Eby wrote: At 10:24 PM 7/8/2005 +0200, Reinhold Birkenfeld wrote: with sys.trace Note that it's currently not possible to inspect the trace/profile hooks from Python code, only from C, so that might be, um, interesting to implement. That was beyond my short view... if it

Re: [Python-Dev] Possible context managers in stdlib

2005-07-08 Thread Raymond Hettinger
I compiled a list of some possible new context managers that could be added to the stdlib. Introducing a new feature should IMO also show usage of it in the distribution itself. That wasn't done with decorators (a decorators module is compiled at the moment, if I'm right), but with

Re: [Python-Dev] Possible context managers in stdlib

2005-07-08 Thread Michael Chermside
James Y Knight writes: It is a really bad idea to codify the practice of modifying non- threadlocal global state like sys.std[in|out|err] and current directory with a context manager. Barry Warsaw responds: Thinking about the types of code I write over and over again, I think I disagree

Re: [Python-Dev] Possible context managers in stdlib

2005-07-08 Thread Reinhold Birkenfeld
Raymond Hettinger wrote: I compiled a list of some possible new context managers that could be added to the stdlib. Introducing a new feature should IMO also show usage of it in the distribution itself. That wasn't done with decorators (a decorators module is compiled at the moment, if

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

2005-07-08 Thread M.-A. Lemburg
Nick Coghlan wrote: 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

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

2005-07-08 Thread Martin v. Löwis
David Abrahams wrote: Unless, of course, I'm missing something. So if I am missing something, what is it? You are missing something, and I can only repeat myself. Some systems require main() to be compiled as C++, or else constructors may not work (and perhaps other things fail as well). The

Re: [Python-Dev] GCC version compatibility

2005-07-08 Thread Martin v. Löwis
David Abrahams wrote: When I looked into this problem I saw that configure in fact builds a test executable that included an object file compiled with g++. If the link step with gcc succeeds then LINKCC is set as above, otherwise CXX is used. Obviously, on my system this test was successful so

Re: [Python-Dev] Possible context managers in stdlib

2005-07-08 Thread Skip Montanaro
Ummm... What's a context manager? Skip ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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

2005-07-08 Thread Martin v. Löwis
David Abrahams wrote: If there is some library with such objects that happens to get wrapped and dynamically linked into a Python interpreter Whoa there. How would that ever happen under ordinary circumstances? Doesn't Python's makefile control what gets linked to Python? Not entirely. By

Re: [Python-Dev] Possible context managers in stdlib

2005-07-08 Thread Nick Coghlan
Michael Chermside wrote: I agree with Barry. Not only should they be in the stdlib, but they should have very clear warnings in their docstrings and other documentation that state that they are ONLY safe to use in single-threaded programs. This achieves two things: it makes them available to

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

2005-07-08 Thread David Abrahams
Martin v. Löwis [EMAIL PROTECTED] writes: David Abrahams wrote: If there is some library with such objects that happens to get wrapped and dynamically linked into a Python interpreter Whoa there. How would that ever happen under ordinary circumstances? Doesn't Python's makefile control

Re: [Python-Dev] checklist for filing a bug

2005-07-08 Thread Terry Reedy
Raymond Hettinger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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. -0 on the checklists. I am more enthusiastic