mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] GH-99155: Fix NormalDist
pickle with 0
and 1
protocols (GH-99156). (GH-99188)
(cherry picked from commit d7a00f1e8e
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Automerge-Triggered-By: GH:rhettinger
This commit is contained in:
parent
58c8c1dee7
commit
263e9830aa
3 changed files with 15 additions and 3 deletions
|
@ -1382,3 +1382,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue