]> git.madduck.net Git - etc/vim.git/blobdiff - tests/comments.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 `explode_split` to documentation
[etc/vim.git] / tests / comments.py
index e661ba642af52b4c3e9149e1444886ad0d5ffeff..8ce9ffee49af68759a7605cceea6779c5b70515b 100644 (file)
@@ -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.
 
@@ -40,17 +43,40 @@ def function(default=None):
 
 
 # Explains why we use global state.
-GLOBAL_STATE = {'a': a(1), 'b': a(2), 'c': a(3)}
+GLOBAL_STATE = {"a": a(1), "b": a(2), "c": a(3)}
+
+
+# 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."""
 
 
-# Another comment
 @fast(really=True)
 async def wat():
     async with X.open_async() as x:  # Some more comments
         result = await x.method1()
     # Comment after ending a block.
     if result:
-        print('A OK', file=sys.stdout)
+        print("A OK", file=sys.stdout)
         # Comment between things.
         print()