diff options
author | Guido van Rossum <guido@python.org> | 2003-02-03 18:10:09 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2003-02-03 18:10:09 (GMT) |
commit | 868ecc22ab2207b1f9a36f803eaa58f5c3037657 (patch) | |
tree | bc7b92b584b21822aea8efd725b656d85f5bc8b5 /Lib/pickle.py | |
parent | 795ea89cb51edbebcb23149db5bf95fcb55857b9 (diff) | |
download | cpython-868ecc22ab2207b1f9a36f803eaa58f5c3037657.zip cpython-868ecc22ab2207b1f9a36f803eaa58f5c3037657.tar.gz cpython-868ecc22ab2207b1f9a36f803eaa58f5c3037657.tar.bz2 |
_slotnames(): exclude __dict__ and __weakref__; these aren't real
slots even though they can be listed in __slots__.
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r-- | Lib/pickle.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py index 0d553a7..05772b0 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -881,7 +881,8 @@ def _slotnames(cls): names = [] for c in cls.__mro__: if "__slots__" in c.__dict__: - names += list(c.__dict__["__slots__"]) + names += [name for name in c.__dict__["__slots__"] + if name not in ("__dict__", "__weakref__")] return names def _keep_alive(x, memo): |