Merge lp:~jml/pocket-lint/singleton-tuples into lp:pocket-lint

Proposed by Jonathan Lange
Status: Merged
Approved by: Curtis Hovey
Approved revision: 323
Merged at revision: 323
Proposed branch: lp:~jml/pocket-lint/singleton-tuples
Merge into: lp:pocket-lint
Diff against target: 10 lines (+2/-0)
1 file modified
pocketlint/contrib/pep8.py (+2/-0)
To merge this branch: bzr merge lp:~jml/pocket-lint/singleton-tuples
Reviewer Review Type Date Requested Status
Curtis Hovey code Approve
Review via email: mp+37242@code.launchpad.net

Commit message

Do not warn about valid singleton tuples.

Description of the change

pep8.py warns about singleton tuples written like (foo,). It should not. This branch fixes that.

No tests, since I couldn't find any. I tested by running contrib/pep8.py against a file with the contents:

 foo = (123,)

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thanks for the patch. Should this go upstream?

review: Approve (code)
Revision history for this message
Jonathan Lange (jml) wrote :

On Fri, Oct 1, 2010 at 2:03 PM, Curtis Hovey <email address hidden> wrote:
> Review: Approve code
> Thanks for the patch. Should this go upstream?

Probably. I don't know where official upstream is.

jml

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pocketlint/contrib/pep8.py'
2--- pocketlint/contrib/pep8.py 2009-09-01 04:42:47 +0000
3+++ pocketlint/contrib/pep8.py 2010-10-01 13:01:18 +0000
4@@ -254,6 +254,8 @@
5 before = line[:index]
6 if char == ':' and before.count('[') > before.count(']'):
7 continue # Slice syntax, no space required
8+ if char == ',' and line[index + 1] == ')':
9+ continue # Singleton tuple syntax, no space required
10 return index, "E231 missing whitespace after '%s'" % char
11
12

Subscribers

People subscribed via source and target branches

to all changes: