GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — bpo-1635741 - port unicodedata to multi-phase init by koubaa · Pull Request #22145 · python/cpython Conversation
|
|
I am taking the approach of putting the module in the capsule struct. This requires the client code to pass in the module (and will need some note in the changelog) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would prefer with a first short PR to prepare the work to just pass a state to UCD_Check(), without all other changes.
This PR is too big, I cannot review it. GitHub even hides the diff by default because it is too large :-D
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I created https://bugs.python.org/issue41798 "meta-issue" to discuss the usage of the PyCapsule C API with multi-phase init API (PEP 489). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
That sounds like a good plan, to pass the module through a state. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
@vstinner Since the module state (which contains the capsule and a type) is new in this PR, it would be a struct with Most of the changes are breaking the functions (which are shared between the module and the type) into different entry points for either - so that I can get the module state from both flavors in the way that works for them. I propose to make the first stage just about this indirection, without switching to any heap types. What do you think? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
You can try to work in multiple steps (multiple PRs):
For the module state, it may be more flexible to pass ucnhash_CAPI to getname() and getcode() this API, rather than passing ucnhash_CAPI->module as the first parameter. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@vstinner step 1 is equivalent to Are there any examples of heap types without module state that I can refer to? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@vstinner This is definitely pythonic 👍 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is outdated, unicodedata got many changes in the meanwhile. I proposed one approach to convert unicodedata to multi-phase init in https://bugs.python.org/issue42157 I close this PR. Once PR #22990 will be merged, I will propose a PR to finally convert the module to multi-phase init. Sorry for the misunderstanding, but this extension module is way more complex than other extensions, and I didn't spot all corner cases at the first review. See the bpo for the list of all issues and my proposal. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.