Commits

Anonymous committed ca8c619

Don't disregard return annotations for functions without any parameters.

  • Participants
  • Parent commits a8ffb18

Comments (0)

Files changed (2)

 * Fix a problem with index generation in LaTeX output, caused by
   hyperref not being included last.
 
+* Don't disregard return annotations for functions without any parameters.
+
 
 Release 0.4.3 (Oct 8, 2008)
 ===========================

File sphinx/directives/desc.py

         raise ValueError
     classname, name, arglist, retann = m.groups()
 
+    if retann:
+        retann = u' \N{RIGHTWARDS ARROW} ' + retann.strip()[2:]
+
     if env.currclass:
         add_module = False
         if classname and classname.startswith(env.currclass):
         if desctype in ('function', 'method', 'staticmethod'):
             # for callables, add an empty parameter list
             signode += addnodes.desc_parameterlist()
+        if retann:
+            signode += addnodes.desc_type(retann, retann)
         return fullname, classname
     signode += addnodes.desc_parameterlist()
 
     if len(stack) != 1:
         raise ValueError
     if retann:
-        retann = u' \N{RIGHTWARDS ARROW} ' + retann.strip()[2:]
         signode += addnodes.desc_type(retann, retann)
     return fullname, classname