This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pingebretson
Recipients pingebretson
Date 2014-02-15.22:49:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1392504544.21.0.429278926318.issue20637@psf.upfronthosting.co.za>
In-reply-to
Content
PEP 412 shared keys are not created for subclasses in Python 3.3 and 3.4:

>>> import sys
>>> class A:
...     pass
... 
>>> class B(A):
...     pass
... 
>>> a, b = A(), B()
>>> sys.getsizeof(vars(a))
96
>>> sys.getsizeof(vars(b))
288

(Actual sizes depend on platform and configuration).

This patch allows subclasses to share keys:

>>> import sys
>>> class A:
...     pass
... 
>>> class B(A):
...     pass
... 
>>> a, b = A(), B()
>>> sys.getsizeof(vars(a))
96
>>> sys.getsizeof(vars(b))
96
History
Date User Action Args
2014-02-15 22:49:04pingebretsonsetrecipients: + pingebretson
2014-02-15 22:49:04pingebretsonsetmessageid: <1392504544.21.0.429278926318.issue20637@psf.upfronthosting.co.za>
2014-02-15 22:49:04pingebretsonlinkissue20637 messages
2014-02-15 22:49:04pingebretsoncreate