Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread Stefan Behnel
[forwarded to the python-ideas list] Stefan ___ 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] [Python-checkins] cpython: _PyImport_LoadDynamicModule() encodes the module name explicitly to ASCII

2011-05-10 Thread Victor Stinner
Le lundi 09 mai 2011 à 22:18 -0500, Michael Urman a écrit : On Mon, May 9, 2011 at 20:08, Neil Hodgson nyamaton...@gmail.com wrote: Yes, Windows will use UTF-16 as it does for almost everything. From a user's point of view, these should both just be seen as Unicode. I'm not convinced

Re: [Python-Dev] [Python-checkins] cpython: Issue #12039: Add end_headers() call to avoid BadStatusLine.

2011-05-10 Thread Senthil Kumaran
On Tue, May 10, 2011 at 10:10:15AM +0200, vinay.sajip wrote: diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -1489,6 +1489,7 @@ except: self.post_data = None

Re: [Python-Dev] Commit changelog: issue number and merges

2011-05-10 Thread Aurélien Campéas
Le 10/05/2011 04:51, Stephen J. Turnbull a écrit : R. David Murray writes: On Mon, 09 May 2011 18:23:45 -0500, Benjamin Petersonbenja...@python.org wrote: *cough* http://mercurial.selenic.com/wiki/GraphlogExtension I'm sorry, but I've looked at the output of that and the

Re: [Python-Dev] Commit messages: please avoid temporal ambiguity

2011-05-10 Thread Nick Coghlan
On Tue, May 10, 2011 at 5:36 AM, Eric Smith e...@trueblade.com wrote: Thanks indeed for bringing this up, Terry. It's been on my to-do list for a while. I think it comes from just copying the title of a bug report. The bug is X does Y, and that's what's used in the fix. I believe I've actually

Re: [Python-Dev] Borrowed and Stolen References in API

2011-05-10 Thread Nick Coghlan
On Tue, May 10, 2011 at 11:53 AM, Marvin Humphrey mar...@rectangular.com wrote: With regards to what actually happens to the reference count, I would argue that incremented and decremented are accurate descriptions.  * When a function returns an incremented object, that function has added    

Re: [Python-Dev] Commit changelog: issue number and merges

2011-05-10 Thread R. David Murray
On Tue, 10 May 2011 11:51:19 +0900, Stephen J. Turnbull step...@xemacs.org wrote: R. David Murray writes: On Mon, 09 May 2011 18:23:45 -0500, Benjamin Peterson benja...@python.org wrote: *cough* http://mercurial.selenic.com/wiki/GraphlogExtension I'm sorry, but I've looked at

Re: [Python-Dev] Commit changelog: issue number and merges

2011-05-10 Thread Nick Coghlan
On Tue, May 10, 2011 at 12:51 PM, Stephen J. Turnbull step...@xemacs.org wrote: R. David Murray writes:   On Mon, 09 May 2011 18:23:45 -0500, Benjamin Peterson benja...@python.org wrote:   *cough* http://mercurial.selenic.com/wiki/GraphlogExtension     I'm sorry, but I've looked at the

Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread R. David Murray
On Tue, 10 May 2011 08:36:38 +0300, Eli Bendersky eli...@gmail.com wrote: With an unlimited error message length it could make sense to say Hey, I see 'x' may be assigned in this scope, so I mark it local. But this access to 'x' happens before assignment - so ERROR. This isn't realistic, of

Re: [Python-Dev] Commit messages: please avoid temporal ambiguity

2011-05-10 Thread R. David Murray
On Tue, 10 May 2011 22:29:58 +1000, Nick Coghlan ncogh...@gmail.com wrote: On Tue, May 10, 2011 at 5:36 AM, Eric Smith e...@trueblade.com wrote: Thanks indeed for bringing this up, Terry. It's been on my to-do list for a while. I think it comes from just copying the title of a bug report.

Re: [Python-Dev] [Python-checkins] cpython: _PyImport_LoadDynamicModule() encodes the module name explicitly to ASCII

2011-05-10 Thread Michael Urman
On Tue, May 10, 2011 at 03:03, Victor Stinner victor.stin...@haypocalc.com wrote: If GetProcAddress() expects a byte string encoded to the ANSI code page, my patch is correct because the function used the UTF-8 encoding, not the ANSI code page. We can maybe use GetProcAddressW() to pass a

Re: [Python-Dev] Commit messages: please avoid temporal ambiguity

2011-05-10 Thread Oleg Broytman
On Tue, May 10, 2011 at 09:33:13AM -0400, R. David Murray wrote: commit: 11999: sync based on comparing mtimes, not mtime to system clock NEWS: Issue 11999: fixed sporadic sync failure mailbox.Maildir due to its trying to detect mtime changes by comparing to the system clock

Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread Eli Bendersky
On Tue, May 10, 2011 at 16:11, R. David Murray rdmur...@bitdance.comwrote: On Tue, 10 May 2011 08:36:38 +0300, Eli Bendersky eli...@gmail.com wrote: With an unlimited error message length it could make sense to say Hey, I see 'x' may be assigned in this scope, so I mark it local. But this

Re: [Python-Dev] Commit messages: please avoid temporal ambiguity

2011-05-10 Thread R. David Murray
On Tue, 10 May 2011 17:45:44 +0400, Oleg Broytman p...@phdru.name wrote: On Tue, May 10, 2011 at 09:33:13AM -0400, R. David Murray wrote: commit: 11999: sync based on comparing mtimes, not mtime to system clock NEWS: Issue 11999: fixed sporadic sync failure mailbox.Maildir due to

Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread Nick Coghlan
On Tue, May 10, 2011 at 11:11 PM, R. David Murray rdmur...@bitdance.com wrote: How about: reference to variable 'y' precedes an assignment that makes it a local variable For comparison, the error messages I was able to elicit from 2.7 were as follows: # Module level NameError: name 'bob' is

Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread R. David Murray
On Wed, 11 May 2011 00:59:08 +1000, Nick Coghlan ncogh...@gmail.com wrote: On Tue, May 10, 2011 at 11:11 PM, R. David Murray rdmur...@bitdance.com w= rote: How about: reference to variable 'y' precedes an assignment that makes it a local variable For comparison, the error messages I

Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread Terry Reedy
On 5/10/2011 10:59 AM, Nick Coghlan wrote: On Tue, May 10, 2011 at 11:11 PM, R. David Murrayrdmur...@bitdance.com wrote: How about: reference to variable 'y' precedes an assignment that makes it a local variable For comparison, the error messages I was able to elicit from 2.7 were as

Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread R. David Murray
On Tue, 10 May 2011 13:56:58 -0400, Terry Reedy tjre...@udel.edu wrote: On 5/10/2011 10:59 AM, Nick Coghlan wrote: On Tue, May 10, 2011 at 11:11 PM, R. David Murrayrdmur...@bitdance.com wrote: How about: reference to variable 'y' precedes an assignment that makes it a local variable

Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread Eli Bendersky
snip # Early reference to local UnboundLocalError: local variable 'bob' referenced before assignment I would change this to local name 'bob' used before the assignment that makes it a local name Calling names 'variables' is itself a point of confusion. Yes, your phrasing is much

Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread Steven D'Aprano
Nick Coghlan wrote: Personally, I would just add in current scope to the existing error message for the unbound local case (and potentially collapse the exception hierarchy a bit by setting UnboundLocalError = NameError). -0 That was the case prior to Python 2.0. Reverting is potentially a

Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread Fred Drake
On Tue, May 10, 2011 at 6:38 PM, Steven D'Aprano st...@pearwood.info wrote: I don't know why it was thought necessary to distinguish between them in the first place. New users almost constantly expressed confusion by NameError when the name was clearly bound at global scope, and a subsequent