Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUG: stats: The method _construct_default_doc did not properly handle…

… the default value of the extradoc keyword (ticket #1316).
  • Loading branch information...
commit 44ca4c15ddd49a31bf1801a6a81291d2916a3bba 1 parent 33cccf6
warren.weckesser authored
View
4 scipy/stats/distributions.py
@@ -971,6 +971,10 @@ def __init__(self, momtype=1, a=None, b=None, xa=-10.0, xb=10.0,
def _construct_default_doc(self, longname=None, extradoc=None):
"""Construct instance docstring from the default template."""
+ if longname is None:
+ longname = 'A'
+ if extradoc is None:
+ extradoc = ''
if extradoc.startswith('\n\n'):
extradoc = extradoc[2:]
self.__doc__ = ''.join(['%s continuous random variable.'%longname,
View
7 scipy/stats/tests/test_distributions.py
@@ -556,5 +556,12 @@ def test_regression_02(self):
assert_equal(m1, m2)
+def test_regression_ticket_1316():
+ """Regression test for ticket #1316."""
+ # The following was raising an exception, because _construct_default_doc()
+ # did not handle the default keyword extradoc=None. See ticket #1316.
+ g = stats.distributions.gamma_gen(name='gamma')
+
+
if __name__ == "__main__":
run_module_suite()
Please sign in to comment.
Something went wrong with that request. Please try again.