Skip to content

Commit 3fb47d1

Browse files
iKevinYJukkaL
authored andcommitted
Add additional information to syntax cheat sheet (#2250)
1 parent d975b23 commit 3fb47d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/source/cheat_sheet.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Built-in types
2424
# For simple built-in types, just use the name of the type.
2525
x = 1 # type: int
2626
x = 1.0 # type: float
27+
x = True # type: bool
2728
x = "test" # type: str
2829
x = u"test" # type: unicode
2930
@@ -61,6 +62,11 @@ Functions
6162
"""Your function docstring goes here after the type definition."""
6263
return str(num)
6364
65+
# This function has no parameters and also returns nothing. Annotations
66+
# can also be placed on the same line as their function headers.
67+
def greet_world(): # type: () -> None
68+
print "Hello, world!"
69+
6470
# And here's how you specify multiple arguments.
6571
def plus(num1, num2):
6672
# type: (int, int) -> int

0 commit comments

Comments
 (0)