diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-11-07 02:56:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 02:56:41 (GMT) |
commit | bef9efabc3f899a8f05cc6bee009c7c5fb3d01ae (patch) | |
tree | 11b29d0b6a93c99dd55b31a4bd6bbc7e224dfe0b /Lib/statistics.py | |
parent | f626b7b504df454d289527a4f922b09deeae9e21 (diff) | |
download | cpython-bef9efabc3f899a8f05cc6bee009c7c5fb3d01ae.zip cpython-bef9efabc3f899a8f05cc6bee009c7c5fb3d01ae.tar.gz cpython-bef9efabc3f899a8f05cc6bee009c7c5fb3d01ae.tar.bz2 |
GH-99155: Fix `NormalDist` pickle with `0` and `1` protocols (GH99156)
Diffstat (limited to 'Lib/statistics.py')
-rw-r--r-- | Lib/statistics.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/statistics.py b/Lib/statistics.py index b4adabd..07d1fd5 100644 --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -1446,3 +1446,9 @@ class NormalDist: def __repr__(self): return f'{type(self).__name__}(mu={self._mu!r}, sigma={self._sigma!r})' + + def __getstate__(self): + return self._mu, self._sigma + + def __setstate__(self, state): + self._mu, self._sigma = state |