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 klappnase
Recipients GNJ, klappnase, serhiy.storchaka, tkinter
Date 2016-10-24.09:21:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477300899.98.0.790604832096.issue28498@psf.upfronthosting.co.za>
In-reply-to
Content
At least with python 3.4 here wantobjects still is valid, and personally I really hope that it remains this way, because I use to set wantobjects=False in my own code to avoid having to deal with errors because of some method or other unexpectedly returning TclObjects instead of Python objects (which has been happening here occasionally ever since they were invented).
I am practically illiterate with C, so I cannot tell what this code does, but at least I believe I see clearly here that it appears to be still used:

static TkappObject *
Tkapp_New(const char *screenName, const char *className,
          int interactive, int wantobjects, int wantTk, int sync,
          const char *use)
{
    TkappObject *v;
    char *argv0;

    v = PyObject_New(TkappObject, (PyTypeObject *) Tkapp_Type);
    if (v == NULL)
        return NULL;
    Py_INCREF(Tkapp_Type);

    v->interp = Tcl_CreateInterp();
    v->wantobjects = wantobjects;
    v->threaded = Tcl_GetVar2Ex(v->interp, "tcl_platform", "threaded",
                                TCL_GLOBAL_ONLY) != NULL;
    v->thread_id = Tcl_GetCurrentThread();
    v->dispatching = 0;
(...)

static PyObject*
Tkapp_CallResult(TkappObject *self)
{
    PyObject *res = NULL;
    Tcl_Obj *value = Tcl_GetObjResult(self->interp);
    if(self->wantobjects) {
        /* Not sure whether the IncrRef is necessary, but something
           may overwrite the interpreter result while we are
           converting it. */
        Tcl_IncrRefCount(value);
        res = FromObj((PyObject*)self, value);
        Tcl_DecrRefCount(value);
    } else {
        res = unicodeFromTclObj(value);
    }
    return res;
}
History
Date User Action Args
2016-10-24 09:21:40klappnasesetrecipients: + klappnase, serhiy.storchaka, tkinter, GNJ
2016-10-24 09:21:39klappnasesetmessageid: <1477300899.98.0.790604832096.issue28498@psf.upfronthosting.co.za>
2016-10-24 09:21:39klappnaselinkissue28498 messages
2016-10-24 09:21:38klappnasecreate