Skip to content

Commit 3674a98

Browse files
authored
Create example.py
1 parent 10ae26a commit 3674a98

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

example.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import math, sys;
2+
3+
def example1():
4+
####This is a long comment. This should be wrapped to fit within 72 characters.
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]}}
10+
return (some_tuple, some_variable)
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 = """
18+
Indentation in multiline strings should not be touched.
19+
Only actual code should be reindented.
20+
"""
21+
return (sys.path, some_string)

0 commit comments

Comments
 (0)