Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Description
Feature or enhancement
I would like to add an API function like this:
/* Attempt to assign a version tag to the given type. * * Returns 1 if the type already had a valid version tag or a new one was * assigned, or 0 if a new tag could not be assigned. */PyAPI_FUNC(int) _PyType_AssignVersionTag(PyTypeObject* type);It would be a thin wrapper around the existingassign_version_tag function, and is modeled after a similar function we added to Cinder as part offacebookincubator/cinder@43c4e2d.
Pitch
Cinder (and possibly other JITs or optimizing interpreters) would benefit from being able to ensure that type has a valid version tag without having to call_PyType_Lookup() just for the version-assigning side-effect. We rely on notifications fromPyType_Modified() to invalidate code in our JIT when types change, and this only works when the types in question have valid version tags.
Previous discussion
There's no written discussion I'm aware of, but@carljm and@markshannon have discussed this offline.