Visitar URL original
gh-117398: Statically Allocate the Datetime C-API by ericsnowcurrently · Pull Request #119472 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a note.
  • Loading branch information
ericsnowcurrently committed May 23, 2024
commit 4dd8ff17c5b9a7fede231d53ab7d3d2891ca7fdc
4 changes: 4 additions & 0 deletions Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -6777,6 +6777,10 @@ static PyMethodDef module_methods[] = {
* be managed carefully. */
// XXX Can we make this const?
static PyDateTime_CAPI capi = {
/* The classes must be readied before used here.
* That will happen the first time the module is loaded.
* They aren't safe to be shared between interpreters,
* but that's okay as long as the module is single-phase init. */
.DateType = &PyDateTime_DateType,
.DateTimeType = &PyDateTime_DateTimeType,
.TimeType = &PyDateTime_TimeType,
Expand Down