templater: rewrite doc of _hybrid class as docstring
authorYuya Nishihara <yuya@tcha.org>
Sun, 24 Apr 2016 19:15:34 +0900
changeset 31879 868ec199cad0
parent 31878 4d0465dd13d2
child 31880 a0f2d83f8083
templater: rewrite doc of _hybrid class as docstring
mercurial/templatekw.py
--- a/mercurial/templatekw.py	Sun Apr 09 11:57:09 2017 +0900
+++ b/mercurial/templatekw.py	Sun Apr 24 19:15:34 2016 +0900
@@ -19,14 +19,17 @@
     util,
 )
 
-# This helper class allows us to handle both:
-#  "{files}" (legacy command-line-specific list hack) and
-#  "{files % '{file}\n'}" (hgweb-style with inlining and function support)
-# and to access raw values:
-#  "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
-#  "{get(extras, key)}"
+class _hybrid(object):
+    """Wrapper for list or dict to support legacy template
 
-class _hybrid(object):
+    This class allows us to handle both:
+    - "{files}" (legacy command-line-specific list hack) and
+    - "{files % '{file}\n'}" (hgweb-style with inlining and function support)
+    and to access raw values:
+    - "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
+    - "{get(extras, key)}"
+    """
+
     def __init__(self, gen, values, makemap, joinfmt):
         self.gen = gen
         self.values = values