[Python-checkins] r67023 - in doctools/trunk: CHANGES sphinx/directives/desc.py

georg.brandl python-checkins at python.org
Sat Oct 25 18:41:00 CEST 2008


Author: georg.brandl
Date: Sat Oct 25 18:40:59 2008
New Revision: 67023
Log:
Don't disregard return annotations for functions without any parameters.
Modified:
 doctools/trunk/CHANGES
 doctools/trunk/sphinx/directives/desc.py
Modified: doctools/trunk/CHANGES
==============================================================================
--- doctools/trunk/CHANGES	(original)
+++ doctools/trunk/CHANGES	Sat Oct 25 18:40:59 2008
@@ -140,6 +140,8 @@
 * 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)
 ===========================
Modified: doctools/trunk/sphinx/directives/desc.py
==============================================================================
--- doctools/trunk/sphinx/directives/desc.py	(original)
+++ doctools/trunk/sphinx/directives/desc.py	Sat Oct 25 18:40:59 2008
@@ -199,6 +199,9 @@
 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):
@@ -233,6 +236,8 @@
 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()
 
@@ -255,7 +260,6 @@
 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
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /