Skip to content

Port zoneinfo module to use module state #99138

Closed
@sobolevn

Description

@sobolevn

Feature or enhancement

Following https://github.com/ericsnowcurrently/multi-core-python/wiki/0-The-Plan we need to convert _zoneinfo to use module state.

Pitch

Right now there are several global objects:

static PyObject *io_open = NULL;
static PyObject *_tzpath_find_tzfile = NULL;
static PyObject *_common_mod = NULL;

and

static PyObject *TIMEDELTA_CACHE = NULL;
static PyObject *ZONEINFO_WEAK_CACHE = NULL;
static StrongCacheNode *ZONEINFO_STRONG_CACHE = NULL;
static size_t ZONEINFO_STRONG_CACHE_MAX_SIZE = 8;
static _ttinfo NO_TTINFO = {NULL, NULL, NULL, 0};

And one static type definition:

static PyTypeObject PyZoneInfo_ZoneInfoType;

If this is indeed planned to be fixed, I would love to work on it.

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions