[Scipy-svn] r6950 - trunk/scipy/stats

scipy-svn@scip... scipy-svn@scip...
Sat Nov 27 22:01:40 CST 2010


Author: rgommers
Date: 2010-11-27 22:01:40 -0600 (Sat, 27 Nov 2010)
New Revision: 6950

Modified:
   trunk/scipy/stats/distributions.py
Log:
BUG: handle missing extradoc in stats.rv_discrete.

Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py	2010-11-27 18:40:26 UTC (rev 6949)
+++ trunk/scipy/stats/distributions.py	2010-11-28 04:01:40 UTC (rev 6950)
@@ -956,8 +956,10 @@
         # of _mom0_sc, vectorize cannot count the number of arguments correctly.
 
         if longname is None:
-            if name[0] in ['aeiouAEIOU']: hstr = "An "
-            else: hstr = "A "
+            if name[0] in ['aeiouAEIOU']:
+                hstr = "An "
+            else:
+                hstr = "A "
             longname = hstr + name
 
         # generate docstring for subclass instances
@@ -4843,6 +4845,12 @@
         self._cdfvec.nin = self.numargs + 1
 
         # generate docstring for subclass instances
+        if longname is None:
+            if name[0] in ['aeiouAEIOU']:
+                hstr = "An "
+            else:
+                hstr = "A "
+            longname = hstr + name
         if self.__doc__ is None:
             self._construct_default_doc(longname=longname, extradoc=extradoc)
         else:
@@ -4853,6 +4861,8 @@
 
     def _construct_default_doc(self, longname=None, extradoc=None):
         """Construct instance docstring from the rv_discrete template."""
+        if extradoc is None:
+            extradoc = ''
         if extradoc.startswith('\n\n'):
             extradoc = extradoc[2:]
         self.__doc__ = ''.join(['%s discrete random variable.'%longname,



More information about the Scipy-svn mailing list