]> granicus.if.org Git - python/commit
Instead of bad hacks trying to worm around the inherited
authorGuido van Rossum <guido@python.org>
Tue, 28 Jan 2003 22:01:16 +0000 (22:01 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 28 Jan 2003 22:01:16 +0000 (22:01 +0000)
commitac5b5d2e8b849c499d323b0263ace22e56b4f0d9
tree4fa065587d1f06ea638dea49df848815c553b7b5
parent7821d7230cde1f8e12894782fb59bf91dbd6d640
Instead of bad hacks trying to worm around the inherited
object.__reduce__, do a getattr() on the class so we can explicitly
test for it.  The reduce()-calling code becomes a bit more regular as
a result.

Also add support slots: if an object has slots, the default state is
(dict, slots) where dict is the __dict__ or None, and slots is a dict
mapping slot names to slot values.  We do a best-effort approach to
find slot names, assuming the __slots__ fields of classes aren't
modified after class definition time to misrepresent the actual list
of slots defined by a class.
Lib/pickle.py