Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from avelino/master
Implementation PEP8 and Encode UTF-8
- Loading branch information
Showing
19 changed files
with
118 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,6 @@ | |||
"wat" | # -*- coding: utf-8 -*- | ||
|
|||
"""wat""" | |||
print __name__ | print __name__ | ||
print __doc__ | print __doc__ | ||
print object | print object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,14 +1,20 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
class test(object): | class test(object): | ||
@staticmethod |
|
||
def static(a,b,c): | @staticmethod | ||
print a, b, c | def static(a,b,c): | ||
|
|
||
@classmethod | print a, b, c | ||
def clsm(cls, a, b, c): |
|
||
print cls, a, b, c | @classmethod | ||
def clsm(cls, a, b, c): | |||
|
|||
print cls, a, b, c | |||
|
|||
|
|
||
test.static(1,2,3) # => "1 2 3" | test.static(1,2,3) # => "1 2 3" | ||
test.clsm(1,2,3) # => "<type 'test'> 1 2 3" | test.clsm(1,2,3) # => "<type 'test'> 1 2 3" | ||
|
|
||
test().static(1,2,3) # => "1 2 3" | test().static(1,2,3) # => "1 2 3" | ||
test().clsm(1,2,3) # => "<type 'test'> 1 2 3" | test().clsm(1,2,3) # => "<type 'test'> 1 2 3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,18 +1,21 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
z = 'watevah' | z = 'watevah' | ||
|
|
||
def blah(a,k='b'): | def blah(a,k='b'): | ||
def blorp(b): |
|
||
print(b) #3 | def blorp(b): | ||
print(a) #4 |
|
||
print(z) #5 | print(b) #3 | ||
print(__name__) #6 | print(a) #4 | ||
|
print(z) #5 | ||
l = lambda x: x | print(__name__) #6 | ||
#def l(x): return x |
|
||
|
l = lambda x: x | ||
print(l("zoom!")) #1 | #def l(x): return x | ||
|
print(l("zoom!")) #1 | ||
print(a,k) #2 | print(a,k) #2 | ||
blorp("boom") | blorp("boom") | ||
|
|||
|
|
||
blah("floom") | blah("floom") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,5 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
a = 22 | a = 22 | ||
b = eval("a * 33") | b = eval("a * 33") | ||
print b | print b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,9 @@ | |||
"The Foo::Bar module" | # -*- coding: utf-8 -*- | ||
|
|||
def bar(): | def bar(): | ||
print "BAR" | """The Foo::Bar module""" | ||
|
|||
print "BAR" | |||
|
|||
|
|||
bar() | bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,2 +1,6 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
from imported import foo | from imported import foo | ||
|
|||
|
|||
print foo() | print foo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,2 +1,6 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
from imported import foo as bar | from imported import foo as bar | ||
|
|||
|
|||
print bar() | print bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,9 +1,14 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
def greet(name, wat, blorp = 'woop', zoop = 'noop'): | def greet(name, wat, blorp = 'woop', zoop = 'noop'): | ||
|
|||
print '---' | print '---' | ||
print 'hello', name | print 'hello', name | ||
print 'wat:', wat | print 'wat:', wat | ||
print 'blorp:', blorp | print 'blorp:', blorp | ||
print 'zoop:', zoop | print 'zoop:', zoop | ||
|
|||
|
|||
greet('Jack', 'stuff') | greet('Jack', 'stuff') | ||
greet('Jill', 'cffuf', 'tuff') | greet('Jill', 'cffuf', 'tuff') | ||
greet('Bob', 'wat') | greet('Bob', 'wat') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1 +1,3 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
print("hello world") | print("hello world") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,6 +1,7 @@ | |||
import imported | # -*- coding: utf-8 -*- | ||
|
|||
print(imported.__doc__) | |||
|
|
||
import imported | |||
import foo.bar | import foo.bar | ||
|
|
||
|
|||
print(imported.__doc__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,2 +1,6 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
import imported as foo | import imported as foo | ||
print(foo.__name__) # => "imported" |
|
||
# => "imported" | |||
print(foo.__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,6 +1,8 @@ | |||
"imported module" | # -*- coding: utf-8 -*- | ||
|
|
||
def foo(): | def foo(): | ||
"""imported module""" | |||
return "FOO" | return "FOO" | ||
|
|
||
|
|||
print __name__ | print __name__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,5 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
1 | 1 | ||
2.3 | 2.3 | ||
"a b c" | "a b c" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,7 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
def foo(): | def foo(): | ||
pass | pass | ||
|
|||
|
|||
print foo() | print foo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,6 +1,8 @@ | |||
from __ruby__ import require | # -*- coding: utf-8 -*- | ||
|
|
||
require('rbconfig') | from __ruby__ import require | ||
from __ruby__.Config.CONFIG import fetch as rb | from __ruby__.Config.CONFIG import fetch as rb | ||
|
|
||
|
|||
require('rbconfig') | |||
print rb("RUBY_INSTALL_NAME") # => rbx | print rb("RUBY_INSTALL_NAME") # => rbx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,6 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
print None | print None | ||
print None.__class__ | print None.__class__ | ||
print NotImplemented | print NotImplemented | ||
print NotImplemented.__class__ | print NotImplemented.__class__ |