bpo-1635741 - port unicodedata to multi-phase init#22145
Closed
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second attempt, this time I'm slightly less ignorant about CPython core and argument clinic.
"Every problem in software engineering can be solved by adding a layer of indirection". I hope this is true about porting unicodedata to multi-phase init.
The challenge with this module is that the methods are shared between the module, class and in some cases a capsule API. Each of those cases will have its own way to get the module state (which is optional in the case of the capsule API).
I created internal functions like
unicodedata_UCD_normalize_internalwhich is passed in the module state. The class methods pass it in by getting it from the defining class, the module methods get it their own way.https://bugs.python.org/issue1635741