gh-148450: abc.register needs to update type_version when tp_flags is changed.#148623
gh-148450: abc.register needs to update type_version when tp_flags is changed.#148623cocolato wants to merge 2 commits intopython:mainfrom
abc.register needs to update type_version when tp_flags is changed.#148623Conversation
|
This looks correct to me. Setting flags means that caches based on the type version should be invalidated. You can't call Minor improvement suggestion: I would adjust the comment to explain that ideally the setting of flags and clearing (invalidation) of version would be done in one step. However, because the version invalidation must be done with the world not stopped, we need to do these two steps. Regarding the 3.13 backport: the code is different in that version, there is no stop-the-world done. With 3.13, there are data races on on tp_flags (since they are read without a lock and without atomics). For the backport, you would just not worry about that and call |
abc.registerchangestp_flagswithout updatingtype_version#148450