[issue20637] Support key-sharing dictionaries in subclasses

2014-03-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset afae24cb81d9 by Benjamin Peterson in branch '3.4': correct the fix for #20637; allow slot descriptor inheritance to take place before creating cached keys http://hg.python.org/cpython/rev/afae24cb81d9 -- ___

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 16229573e73e by Antoine Pitrou in branch 'default': Issue #20637: Key-sharing now also works for instance dictionaries of subclasses. Patch by Peter Ingebretson. http://hg.python.org/cpython/rev/16229573e73e -- nosy: +python-dev _

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks. I've committed a patch after augmenting the tests a bit, so it'll be in 3.4.1 as well as 3.5. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed versions: +Python 3.4 __

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread Larry Hastings
Larry Hastings added the comment: I agree: definitely not for 3.5, maybe for 3.4.1. -- nosy: +larry ___ Python tracker ___ ___ Python-

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread STINNER Victor
STINNER Victor added the comment: > Also, I think this should go into 3.4 I think that it's too late for optimizations in Python 3.4 (RC1 is alread out). It can wait Python 3.5, or maybe 3.4.1. -- nosy: +haypo ___ Python tracker

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread Mark Shannon
Mark Shannon added the comment: This looks good to me. Also, I think this should go into 3.4 It is a tiny patch and could result in significant memory saving for OO programs with inheritance (e.g. Django) -- ___ Python tracker

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread Peter Ingebretson
Peter Ingebretson added the comment: Thanks Mark, I agree. I thought that assigning to tp_dictoffset in inherit_special was redundant with the assignment in inherit_slot and the assignment I added, but I see that COPYSLOT and COPYVAL are slightly different and extension types won't go through

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread Mark Shannon
Mark Shannon added the comment: Well spotted. I don't think that the line COPYVAL(tp_dictoffset); should be removed. inherit_special() is called from PyType_Ready which is used to initialise static TypeObjects. So builtin class B which doesn't set tp_dictoffset, but has builtin class A as its

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Wow, really? Thanks for finding this! -- nosy: +Mark.Shannon, benjamin.peterson, pitrou stage: -> patch review ___ Python tracker ___ _

[issue20637] Support key-sharing dictionaries in subclasses

2014-02-15 Thread Peter Ingebretson
New submission from Peter Ingebretson: 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