[issue2349] Py3K warn against assigning to True/False

2008-06-08 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Here's a much better patch that delegates checking to a helper. Added file: http://bugs.python.org/file10551/bool_assign7.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349

[issue2349] Py3K warn against assigning to True/False

2008-06-08 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: The macro at the top of the patch should be removed, then this can be checked in. -- resolution: - accepted ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349

[issue2349] Py3K warn against assigning to True/False

2008-06-08 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Done in r64044. -- resolution: accepted - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 ___

[issue2349] Py3K warn against assigning to True/False

2008-06-07 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Georg, can I apply? -- assignee: brett.cannon - georg.brandl nosy: +georg.brandl ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 ___

[issue2349] Py3K warn against assigning to True/False

2008-05-18 Thread Benjamin Peterson
Changes by Benjamin Peterson [EMAIL PROTECTED]: -- assignee: benjamin.peterson - brett.cannon __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __ ___

[issue2349] Py3K warn against assigning to True/False

2008-05-17 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: I'm attaching a new patch with changes made from the Georg's comments. Added file: http://bugs.python.org/file10359/bool_assign6.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349

[issue2349] Py3K warn against assigning to True/False

2008-05-03 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Okay, now that #2720 was dealt with, here's another (close to final) patch. I added an ast_warn help function. When -Werror is used, the warnings are converted to SyntaxErrors. Raymond or Brett, if you could take a look, that would be great.

[issue2349] Py3K warn against assigning to True/False

2008-05-02 Thread Benjamin Peterson
Changes by Benjamin Peterson [EMAIL PROTECTED]: -- dependencies: +make compiling struct be passed around to all ast helpers __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __

[issue2349] Py3K warn against assigning to True/False

2008-04-29 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: As I looked over the code again, I realized that it doesn't help to just do a normal warning while compiling because the line number isn't supplied. You have to use PyWarn_Explicit for that (see the warning about backquotes). Since the

[issue2349] Py3K warn against assigning to True/False

2008-04-28 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: If Raymond says it's fine, then it's also fine by me. -- assignee: brett.cannon - benjamin.peterson __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __

[issue2349] Py3K warn against assigning to True/False

2008-04-05 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Brett, shall I apply? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __ ___ Python-bugs-list mailing list

[issue2349] Py3K warn against assigning to True/False

2008-03-22 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Keep what you've got but don't lose sleep if some offbeat case is not covered. -- assignee: rhettinger - brett.cannon __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349

[issue2349] Py3K warn against assigning to True/False

2008-03-19 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: Actually, the patch is incomplete. You can still do assignment through things such as ``def True(): pass``. If you go through ast.c and find the various places None is protected (search for \None\ and note the places where an ast_error() call is

[issue2349] Py3K warn against assigning to True/False

2008-03-19 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Wow! I never realized how many ways you could possibly assign to something. I found all the None assignments and put the True/False ones under it. Added file: http://bugs.python.org/file9772/bool_assign3.patch

[issue2349] Py3K warn against assigning to True/False

2008-03-19 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: I just added on a test. Added file: http://bugs.python.org/file9773/bool_assign4.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __

[issue2349] Py3K warn against assigning to True/False

2008-03-19 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: FWIW, I don't think it's important to catch every possible assignment. Add warnings for the common cases and declare victory. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349

[issue2349] Py3K warn against assigning to True/False

2008-03-19 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Do you think we should remove some? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __ ___ Python-bugs-list mailing

[issue2349] Py3K warn against assigning to True/False

2008-03-19 Thread Brett Cannon
Changes by Brett Cannon [EMAIL PROTECTED]: -- assignee: brett.cannon - rhettinger __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __ ___ Python-bugs-list mailing

[issue2349] Py3K warn against assigning to True/False

2008-03-18 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Back to Brett for application. -- assignee: rhettinger - brett.cannon __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Brett Cannon
New submission from Brett Cannon [EMAIL PROTECTED]: Assigning to True of False should raise at least a Py3K warning (maybe something more severe?). -- components: Interpreter Core keywords: 26backport messages: 63717 nosy: brett.cannon priority: immediate severity: normal status: open

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Brett Cannon
Changes by Brett Cannon [EMAIL PROTECTED]: -- priority: immediate - urgent __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __ ___ Python-bugs-list mailing list

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: I would like to review the patch on this one. I think it should limit itself to the True and False in builtin. It would be *very* expensive to check for every assignment in every possible namespace. -- nosy: +rhettinger

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Brett Cannon
Brett Cannon [EMAIL PROTECTED] added the comment: On Mon, Mar 17, 2008 at 3:41 PM, Raymond Hettinger [EMAIL PROTECTED] wrote: Raymond Hettinger [EMAIL PROTECTED] added the comment: I would like to review the patch on this one. I think it should limit itself to the True and False in

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: The parser approach should be fine. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __ ___ Python-bugs-list mailing

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: I'm working on it. -- nosy: +benjamin.peterson __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __ ___

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: This patch alters the parser to warn for assignment to True and False. Enjoy! -- keywords: +patch Added file: http://bugs.python.org/file9703/bool_assign.patch __ Tracker [EMAIL PROTECTED]

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: Looks fine. Please apply. -- resolution: - accepted __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __ ___

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Sorry, I don't permission. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __ ___ Python-bugs-list mailing list

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: I'll apply when I get a chance. -- assignee: - rhettinger __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2349 __

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: This is a minor concern, but existing -3 warnings refer to python 3.0 and above as 3.x, not 'Py3K'. It would be nice to preserve consistency. -- nosy: +belopolsky __ Tracker [EMAIL PROTECTED]

[issue2349] Py3K warn against assigning to True/False

2008-03-17 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: A Foolish Consistency is the Hobgoblin of Little Minds This update makes the warnings say 3.x. Added file: http://bugs.python.org/file9706/bool_assign2.patch __ Tracker [EMAIL PROTECTED]