classification
Title: Extended storage in new-style classes
Type: enhancement Stage: test needed
Components: Interpreter Core Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, ajaksu2, dabrahams, david_abrahams, loewis
Priority: low Keywords:

Created on 2002-02-09 00:51 by david_abrahams, last changed 2010-08-17 21:56 by dabrahams.

Messages (6)
msg61081 - (view) Author: David Abrahams (david_abrahams) Date: 2002-02-09 00:51
I want to be able to reserve some storage in my own 
new-style class objects. Ideally the storage would 
fall before the variable-length section so I didn't 
have to worry about alignment issues.

-Dave
msg61082 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-02-17 00:10
Logged In: YES 
user_id=21627

I cannot fully understand the requirement. Are you talking
about a type implemented in C, or a class in Python?

Assuming it is a C type: Are you defining a type that
inherits from a builtin, or one that doesn't.

Assuming does not inherit: what is the problem with just
setting tp_basicsize correctly?

If it is a C type and it does inherit from a variable-length
builtin, this won't be possible: the API for the base type
won't know about the extra fields. In that case, extend the
type so that it has an __dict__ and put everything into the
dict.
msg61083 - (view) Author: David Abrahams (david_abrahams) Date: 2002-02-17 01:05
Logged In: YES 
user_id=52572

It's a C subtype of PyBaseObjectType, and you can't just 
set tp_basicsize correctly because the base type has its 
own idea of where the variable length section starts and 
doesn't respect a difference in tp_basicsize. I've spoken 
with Guido about this; he understands all the details. I 
entered this feature request in the tracker at his request 
(the weakref subclassing was entered at Fred's request).
msg81811 - (view) Author: Daniel Diniz (ajaksu2) Date: 2009-02-12 19:58
Seems very out of date.
msg114177 - (view) Author: Mark Lawrence (BreamoreBoy) Date: 2010-08-17 21:46
I'll close this unless there's a positive response within a couple of weeks.
msg114180 - (view) Author: Dave Abrahams (dabrahams) Date: 2010-08-17 21:56
I can't imagine what kind of "positive response" you'd want from me.  I responded to the last question asked.  I certainly don't know whether this is still an issue, though.
History
Date User Action Args
2010-08-17 21:56:44dabrahamssetstatus: pending -> open
nosy: + dabrahams
messages: + msg114180

2010-08-17 21:46:38BreamoreBoysetstatus: open -> pending
nosy: + BreamoreBoy
messages: + msg114177

2009-02-12 19:58:46ajaksu2setpriority: normal -> low
nosy: + ajaksu2
messages: + msg81811
stage: test needed
2002-02-09 00:51:52david_abrahamscreate