-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
185 additions
and
9 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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# ============================================================================== | ||
# Class method __init__(). | ||
# ============================================================================== | ||
Given python (class method __init__() with parameters): | ||
class MyClass(object): | ||
|
||
def __init__(self: MyClass): | ||
pass | ||
|
||
Do (trigger doge): | ||
:3\<CR> | ||
\<C-d> | ||
|
||
Expect python (generated comment with :param tags): | ||
class MyClass(object): | ||
|
||
def __init__(self: MyClass): | ||
""" | ||
TODO | ||
|
||
:param self MyClass: TODO | ||
""" | ||
pass | ||
# ============================================================================== | ||
# Class method with advanced type hints. | ||
# ============================================================================== | ||
Given python (class method with advanced type hints): | ||
class MyClass(object): | ||
|
||
def myMethod(self: MyClass, param1: Sequence[T]) -> Generator[int, float, str]: | ||
pass | ||
|
||
Do (trigger doge): | ||
:3\<CR> | ||
\<C-d> | ||
|
||
Expect python (generated comment with :param tags): | ||
class MyClass(object): | ||
|
||
def myMethod(self: MyClass, param1: Sequence[T]) -> Generator[int, float, str]: | ||
""" | ||
TODO | ||
|
||
:param self MyClass: TODO | ||
:param param1 Sequence[T]: TODO | ||
:rtype Generator[int, float, str]: TODO | ||
""" | ||
pass | ||
|
||
# ============================================================================== | ||
# Class method parameters with *args and **kwargs. | ||
# ============================================================================== | ||
Given python (class method parameters with *args and **kwargs): | ||
class MyClass(object): | ||
|
||
def call(self, *args: str, **kwargs: str) -> str: | ||
pass | ||
|
||
Do (trigger doge): | ||
:3\<CR> | ||
\<C-d> | ||
|
||
Expect python (generated comment with :param tags): | ||
class MyClass(object): | ||
|
||
def call(self, *args: str, **kwargs: str) -> str: | ||
""" | ||
TODO | ||
|
||
:param self any: TODO | ||
:param args str: TODO | ||
:param kwargs str: TODO | ||
:rtype str: TODO | ||
""" | ||
pass |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# ============================================================================== | ||
# Functions without parameters. | ||
# ============================================================================== | ||
Given python (function without parameters): | ||
def myFunc(): | ||
pass | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
|
||
Expect python (no changes): | ||
def myFunc(): | ||
""" | ||
TODO | ||
|
||
""" | ||
pass | ||
|
||
# ============================================================================== | ||
# Functions without type hints. | ||
# ============================================================================== | ||
Given python (function without type hints): | ||
def myFunc(param1 = 'string', param2 = 5, param3, param4): | ||
pass | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
|
||
Expect python (generated comment with :param tags): | ||
def myFunc(param1 = 'string', param2 = 5, param3, param4): | ||
""" | ||
TODO | ||
|
||
:param param1 any: TODO | ||
:param param2 any: TODO | ||
:param param3 any: TODO | ||
:param param4 any: TODO | ||
""" | ||
pass | ||
|
||
# ============================================================================== | ||
# Functions with parameters. | ||
# ============================================================================== | ||
Given python (function with parameters): | ||
def myFunc(param1: str = 'string', param2: int = 5): | ||
pass | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
|
||
Expect python (generated comment with :param tags): | ||
def myFunc(param1: str = 'string', param2: int = 5): | ||
""" | ||
TODO | ||
|
||
:param param1 str: TODO | ||
:param param2 int: TODO | ||
""" | ||
pass | ||
|
||
# ============================================================================== | ||
# Functions with advanced type hint parameters. | ||
# ============================================================================== | ||
Given python (functions with advanced type hint parameters): | ||
def myFunc(param1: Callable[[int], None] = False, param2: Callable[[int, Exception], None] = {}) -> Sequence[T]: | ||
pass | ||
|
||
def myFunc(param1: Sequence[T]) -> Generator[int, float, str]: | ||
pass | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
:11\<CR> | ||
\<C-d> | ||
|
||
Expect python (generated comments with :param tags): | ||
def myFunc(param1: Callable[[int], None] = False, param2: Callable[[int, Exception], None] = {}) -> Sequence[T]: | ||
""" | ||
TODO | ||
|
||
:param param1 Callable[[int], None]: TODO | ||
:param param2 Callable[[int, Exception], None]: TODO | ||
:rtype Sequence[T]: TODO | ||
""" | ||
pass | ||
|
||
def myFunc(param1: Sequence[T]) -> Generator[int, float, str]: | ||
""" | ||
TODO | ||
|
||
:param param1 Sequence[T]: TODO | ||
:rtype Generator[int, float, str]: TODO | ||
""" | ||
pass |