Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9ebf4d

Browse files
committed
#17489: Add explanatory comment that __getstate__ is not called.
We don't put coverage directives in the stdlib, but anyone looking at a coverage report for Random should see the comment and understand why the lines aren't covered.
1 parent e3e1c17 commit d9ebf4d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/random.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ def setstate(self, state):
151151

152152
## -------------------- pickle support -------------------
153153

154+
# Issue 17489: Since __reduce__ was defined to fix #759889 this is no
155+
# longer called; we leave it here because it has been here since random was
156+
# rewritten back in 2001 and why risk breaking something.
154157
def __getstate__(self): # for pickle
155158
return self.getstate()
156159

0 commit comments

Comments
 (0)