◐ Shell
clean mode source ↗

Message 163532 - Python tracker

That does look like it will fix the leak, but now I'm actually thinking there's more code from type_new that should also be executed in the PyType_FromSpec case.

I mean things like:
- ensuring __new__ is a static method
- ensuring the standard attribute lookup machinery is configured
- hooking up tp_as_number, tp_as_mapping, etc
- ensuring GC support is configured correctly

If that's all happening somehow, it could use a comment, because I certainly can't see it.

If not, we probably need to factor out some helper functions that type_new and PyType_FromSpec can both call to make sure everything is fully configured.