bpo-36326: Let inspect.getdoc() find docstrings for __slots__ (GH-12498)

This commit is contained in:
Raymond Hettinger 2019-03-25 13:01:13 -07:00 committed by GitHub
parent 713a8ae792
commit d1e768a677
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 3 deletions

View file

@ -709,7 +709,8 @@ class NormalDist:
# https://en.wikipedia.org/wiki/Normal_distribution
# https://en.wikipedia.org/wiki/Variance#Properties
__slots__ = ('mu', 'sigma')
__slots__ = {'mu': 'Arithmetic mean of a normal distribution',
'sigma': 'Standard deviation of a normal distribution'}
def __init__(self, mu=0.0, sigma=1.0):
'NormalDist where mu is the mean and sigma is the standard deviation.'