|
1 |
| -import math, sys |
2 |
| - |
| 1 | +import math, sys; |
3 | 2 |
|
4 | 3 | def example1():
|
5 | 4 | ####This is a long comment. This should be wrapped to fit within 72 characters.
|
6 |
| - some_tuple = (1, 2, 3, "a") |
7 |
| - some_variable = { |
8 |
| - "long": "Long code lines should be wrapped within 79 characters.", |
9 |
| - "other": [ |
10 |
| - math.pi, |
11 |
| - 100, |
12 |
| - 200, |
13 |
| - 300, |
14 |
| - 9876543210, |
15 |
| - "This is a long string that goes on", |
16 |
| - ], |
17 |
| - "more": { |
18 |
| - "inner": "This whole logical line should be wrapped.", |
19 |
| - some_tuple: [1, 20, 300, 40000, 500000000, 60000000000000000], |
20 |
| - }, |
21 |
| - } |
| 5 | + some_tuple=( 1,2, 3,'a' ); |
| 6 | + some_variable={'long':'Long code lines should be wrapped within 79 characters.', |
| 7 | + 'other':[math.pi, 100,200,300,9876543210,'This is a long string that goes on'], |
| 8 | + 'more':{'inner':'This whole logical line should be wrapped.',some_tuple:[1, |
| 9 | + 20,300,40000,500000000,60000000000000000]}} |
22 | 10 | return (some_tuple, some_variable)
|
23 |
| - |
24 |
| - |
25 |
| -def example2(): |
26 |
| - return {"has_key() is deprecated": True}.has_key({"f": 2}.has_key("")) |
27 |
| - |
28 |
| - |
29 |
| -class Example3(object): |
30 |
| - def __init__(self, bar): |
31 |
| - # Comments should have a space after the hash. |
32 |
| - if bar: |
33 |
| - bar += 1 |
34 |
| - bar = bar * bar |
35 |
| - return bar |
36 |
| - else: |
37 |
| - some_string = """ |
| 11 | +def example2(): return {'has_key() is deprecated':True}.has_key({'f':2}.has_key('')); |
| 12 | +class Example3( object ): |
| 13 | + def __init__ ( self, bar ): |
| 14 | + #Comments should have a space after the hash. |
| 15 | + if bar : bar+=1; bar=bar* bar ; return bar |
| 16 | + else: |
| 17 | + some_string = """ |
38 | 18 | Indentation in multiline strings should not be touched.
|
39 | 19 | Only actual code should be reindented.
|
40 | 20 | """
|
41 |
| - return (sys.path, some_string) |
| 21 | + return (sys.path, some_string) |
0 commit comments