[Python-bugs-list] [ python-Bugs-575229 ] multiple inheritance w/ slots dumps core
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 02 Jul 2002 12:13:59 -0700
Bugs item #575229, was opened at 2002-06-28 19:33
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=575229&group_id=5470
Category: Python Interpreter Core
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Cesar Douady (douady)
Assigned to: Nobody/Anonymous (nobody)
Summary: multiple inheritance w/ slots dumps core
Initial Comment:
The following script dumps a core (revision 2.2.1) :
class A(object): __slots__=()
class B(object): pass
class C(A,B) : __slots__=()
C().x=2
basic sizes for those classes are:
A => 8 (correct : no dict, no weakref)
B => 16 (correct : dict and weakref slots added)
C => 8 (incorrect : dict and weakref not inherited from
B)
in the last lines of type_new, variables add_dict and
add_weak
are exploited to add those slots, but only when
slots==NULL.
The best base selected for C is A, which is correct in
my opinion
since slots come from it, but dict and weak refs must
be treated
specially and can come from another base.
I have seen nothing in the cvs repository which may fix
this bug.
I did not submit a patch since this is a touchy part of
the interpreter,
but I may do it upon request.
----------------------------------------------------------------------
>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-07-02 15:13
Message:
Logged In: YES
user_id=33168
I could not replicate this problem from current CVS
nor from 2.2.1+ (cvs). Can you test with the CVS
versions to see if you still have a problem?
for 2.2.1+ the tag is release22-maint
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=575229&group_id=5470