X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/e74117f172e29e8a980e2c9de929ad50d3769150..3ee9ebb0916d76be904c948d62e9b55f569b6f98:/tests/comments.py?ds=sidebyside diff --git a/tests/comments.py b/tests/comments.py index e661ba6..3a39afd 100644 --- a/tests/comments.py +++ b/tests/comments.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# fmt: on # Some license here. # # Has many lines. Many, many lines. @@ -21,6 +22,8 @@ except ImportError: # Some comment before a function. + + def function(default=None): """Docstring comes first. @@ -43,7 +46,30 @@ def function(default=None): GLOBAL_STATE = {'a': a(1), 'b': a(2), 'c': a(3)} -# Another comment +# Another comment! +# This time two lines. + + +class Foo: + """Docstring for class Foo. Example from Sphinx docs.""" + + #: Doc comment for class attribute Foo.bar. + #: It can have multiple lines. + bar = 1 + + flox = 1.5 #: Doc comment for Foo.flox. One line only. + + baz = 2 + """Docstring for class attribute Foo.baz.""" + + def __init__(self): + #: Doc comment for instance attribute qux. + self.qux = 3 + + self.spam = 4 + """Docstring for instance attribute spam.""" + + @fast(really=True) async def wat(): async with X.open_async() as x: # Some more comments