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 — gh-103092: Port some `_ctypes` data types to heap types by neonene · Pull Request #113630 · python/cpython Conversation
|
|
@vstinner Could you review this behavior change? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
_ctypes data types to heap types
|
This is an attempt without hacking type slots. Problem: It is possible that accessing metaclasses cause a crash with bad arguments (e.g. cc PEP 687 experts: @erlend-aasland @kumaraditya303 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Leaving an alternative PR (#113774) which does not have the problem above. However, cc @encukou |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
To make this easier to review -- and to make the issue easier to see for as many reviewers as possible, would you mind sending a PR that adds the IMO, the correct way with the current heap type creation API is to move the initialization to Another option is to improve the type creation API -- e.g. design a slot that works like |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I would prefer a smaller PR. You moved 7 types. Can you start with a PR which change less types and less files at once? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@encukou Is it worth opening a new issue for that? Maybe a custom meta |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Oh, I think it's worth writing a PEP for that :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Sorry, I'm not qualified, as I'm volunteering anonymously. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Why do you think that a PEP is needed for this specific change? Many static types were converted to heap types in the stdlib without a specific PEP. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I think @encukou meant a PEP for this proposed idea in #113630 (comment) :)
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
How are ctypes types than other stdlib extensions types? Is there a metaclass? Why do they need special code for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ah,
/* PyCStructType_Type - a meta type/class. Creating a new class using this one as __metaclass__ will call the constructor StructUnionType_new/init. It replaces the tp_dict member with a new instance of StgDict, and initializes the C accessible fields somehow. */ Extracts: and: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
+1 for a dedicated issue; there is a lot of issues connected to the isolation of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I created the issue gh-114314 "Convert _ctypes PyCStgDict meta static type to a meta heap type". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I wrote PR #114316 for that. It's partially based on this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Unlike this PR, the issue #114314 seems to consider how to refactor the hacks around PyCStgDict, without customizing Any way is fine with me to avoid the error related to #103968: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing the draft in favor of #116458. |
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.