Author vstinner
Recipients Jim Fasarakis-Hilliard, amaury.forgeotdarc, corona10, eric.snow, isoschiz, koubaa, kylotan, lukasz.langa, miss-islington, pconnell, phsilva, python-dev, santoso.wijaya, shihai1991, tlesher, vstinner, ysj.ray
Date 2020-09-08.12:03:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1599566591.67.0.980419128918.issue1635741@roundup.psfhosted.org>
In-reply-to
Content
> Python/_warnings.c

I'm not sure if it's a good idea to convert the _warnings module to multi-phase init, since it uses a state stored in the interpreter:

/* Given a module object, get its per-module state. */
static WarningsState *
warnings_get_state(void)
{
    PyInterpreterState *interp = _PyInterpreterState_GET();
    if (interp == NULL) {
        PyErr_SetString(PyExc_RuntimeError,
                        "warnings_get_state: could not identify "
                        "current interpreter");
        return NULL;
    }
    return &interp->warnings;
}

For example, two _warnings instance would share the _warnings.filters list. Maybe it's ok, I don't know.
History
Date User Action Args
2020-09-08 12:03:11vstinnersetrecipients: + vstinner, amaury.forgeotdarc, kylotan, tlesher, phsilva, ysj.ray, santoso.wijaya, lukasz.langa, python-dev, eric.snow, pconnell, isoschiz, Jim Fasarakis-Hilliard, corona10, miss-islington, shihai1991, koubaa
2020-09-08 12:03:11vstinnersetmessageid: <1599566591.67.0.980419128918.issue1635741@roundup.psfhosted.org>
2020-09-08 12:03:11vstinnerlinkissue1635741 messages
2020-09-08 12:03:11vstinnercreate