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 eric.snow
Recipients eric.snow, ncoghlan
Date 2012-05-29.04:22:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338265345.18.0.815759022315.issue14942@psf.upfronthosting.co.za>
In-reply-to
Content
Presumably you mean something like this:

<examples>

PyObject *
PyType_New(PyObject *name, PyObject *bases, PyObject *ns)
{
    PyObject *type, *args, *newtype;
    PyInterpreterState *interp = PyThreadState_GET()->interp;
    PyObject *modules = interp->modules;
    PyObject *builtins = PyDict_GetItemString(modules, "builtins");
    _Py_IDENTIFIER(type);

    if (builtins == NULL)
        return NULL;
    type = _PyObject_GetAttrId(builtins, &PyId_type);
    if (type == NULL)
        return NULL;
    args = PyTuple_Pack(3, name, bases, ns);
    if (args == NULL)
        return NULL;
    newtype = PyObject_CallObject(type, args);
    Py_DECREF(args);
    return newtype;
}

or even:

PyObject *
PyType_New(PyObject *meta, PyObject *name, PyObject *bases, PyObject *ns)
{
    PyObject *args, *newtype;

    args = PyTuple_Pack(3, name, bases, ns);
    if (args == NULL)
        return NULL;
    newtype = PyObject_CallObject(type, args);
    Py_DECREF(args);
    return newtype;
}

and called with "PyType_New(&PyTypeObject, name, bases, ns)".

</examples>

If that's what you meant, I'm okay with that.  Otherwise please elaborate.  :)
History
Date User Action Args
2012-05-29 04:22:25eric.snowsetrecipients: + eric.snow, ncoghlan
2012-05-29 04:22:25eric.snowsetmessageid: <1338265345.18.0.815759022315.issue14942@psf.upfronthosting.co.za>
2012-05-29 04:22:24eric.snowlinkissue14942 messages
2012-05-29 04:22:24eric.snowcreate