]> git.madduck.net Git - etc/vim.git/blob - tests/data/comments6.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

add to changelog
[etc/vim.git] / tests / data / comments6.py
1 from typing import Any, Tuple
2
3
4 def f(
5     a,  # type: int
6 ):
7     pass
8
9
10 # test type comments
11 def f(a, b, c, d, e, f, g, h, i):
12     # type: (int, int, int, int, int, int, int, int, int) -> None
13     pass
14
15
16 def f(
17     a,  # type: int
18     b,  # type: int
19     c,  # type: int
20     d,  # type: int
21     e,  # type: int
22     f,  # type: int
23     g,  # type: int
24     h,  # type: int
25     i,  # type: int
26 ):
27     # type: (...) -> None
28     pass
29
30
31 def f(
32     arg,  # type: int
33     *args,  # type: *Any
34     default=False,  # type: bool
35     **kwargs,  # type: **Any
36 ):
37     # type: (...) -> None
38     pass
39
40
41 def f(
42     a,  # type: int
43     b,  # type: int
44     c,  # type: int
45     d,  # type: int
46 ):
47     # type: (...) -> None
48
49     element = 0  # type: int
50     another_element = 1  # type: float
51     another_element_with_long_name = 2  # type: int
52     another_really_really_long_element_with_a_unnecessarily_long_name_to_describe_what_it_does_enterprise_style = (
53         3
54     )  # type: int
55     an_element_with_a_long_value = calls() or more_calls() and more()  # type: bool
56
57     tup = (
58         another_element,  # type: int
59         another_really_really_long_element_with_a_unnecessarily_long_name_to_describe_what_it_does_enterprise_style,  # type: int
60     )  # type: Tuple[int, int]
61
62     a = (
63         element
64         + another_element
65         + another_element_with_long_name
66         + element
67         + another_element
68         + another_element_with_long_name
69     )  # type: int
70
71
72 def func(
73     a=some_list[0],  # type: int
74 ):  # type: () -> int
75     c = call(
76         0.0123,
77         0.0456,
78         0.0789,
79         0.0123,
80         0.0456,
81         0.0789,
82         0.0123,
83         0.0456,
84         0.0789,
85         a[-1],  # type: ignore
86     )