Title: Implemented PyType_FromSpecWithBases
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.3
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Robin.Schreiber, loewis, ncoghlan, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2012-06-22 22:34 by Robin.Schreiber, last changed 2012-06-23 22:59 by pitrou. This issue is now closed.

File name Uploaded Description Edit
PyType_FromSpecWithBases.patch Robin.Schreiber, 2012-06-22 22:34
Messages (6)
msg163502 - (view) Author: Robin Schreiber (Robin.Schreiber) * (Python triager) Date: 2012-06-22 22:34
Enhancement to the currently existing PyType_FromSpec() which creates and returns a heap type from a given spec. PyType_FromSpecWithBases() works similar to PyType_FromSpec(), however it sets the bases of the newly created heap type to the types contained inside the passed bases-tuple.
This allows the programmer to reference other heap-types as base types of  a new heap type. This is necessary as the slot-API, which is used for static declarations of the type-spec, currently relies on statically declared type objects as tp_base or tp_bases entries.
msg163678 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-06-23 21:21
New changeset bb6df3781edb by Martin v. Löwis in branch 'default':
Issue #15146: Add PyType_FromSpecWithBases. Patch by Robin Schreiber.
msg163679 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-06-23 21:23
Thanks for the patch. Committed with slight modifications: if the spec contained a tp_base/tp_bases pointer, that needed to be considered.
msg163682 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-06-23 21:47
There was a crash here:
msg163687 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-06-23 22:16
I have no clue what might have caused this. My guess is that there is a refcounting bug *somewhere*.
msg163690 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-06-23 22:59
Ok, 33737210c906 seems to have fixed it.
Date User Action Args
2012-06-23 22:59:16pitrousetmessages: + msg163690
stage: resolved
2012-06-23 22:16:21loewissetmessages: + msg163687
2012-06-23 21:47:53pitrousetnosy: + pitrou
messages: + msg163682
2012-06-23 21:23:08loewissetstatus: open -> closed
resolution: fixed
messages: + msg163679
2012-06-23 21:21:55python-devsetnosy: + python-dev
messages: + msg163678
2012-06-23 09:00:48ncoghlansetnosy: + ncoghlan
2012-06-22 22:35:17Robin.Schreibersetnosy: + loewis
2012-06-22 22:34:40Robin.Schreibercreate