pep0484 return type support

This commit is contained in:
Claude
2015-12-13 23:05:14 +01:00
parent 68cbabe819
commit 7e8112d607
4 changed files with 81 additions and 9 deletions

View File

@@ -2,17 +2,69 @@
# python >= 3.2
# -----------------
# simple classes
# -----------------
class A():
pass
def typehints(a, b: str, c: int, d: int=4):
#?
def function_parameters(a: A, b, c: str, d: int=4):
#? A()
a
#? str()
#?
b
#? int()
#? str()
c
#? int()
d
def return_unspecified():
pass
#?
return_unspecified()
def return_none() -> None:
"""
Return type None means the same as no return type as far as jedi
is concerned
"""
pass
#?
return_none()
def return_str() -> str:
pass
#? str()
return_str()
def return_custom_class() -> A:
pass
#? A()
return_custom_class()
def return_annotation_and_docstring() -> str:
"""
:rtype: int
"""
pass
#? str() int()
return_annotation_and_docstring()
def return_annotation_and_docstring_different() -> str:
"""
:rtype: str
"""
pass
#? str()
return_annotation_and_docstring_different()