We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contactedHave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| @@ -0,0 +1,2 @@ | ||
| Add PyCFunction_CheckExact() macro for exact type checks now that we allow subtypes of PyCFunction, | ||
| as well as PyCMethod_CheckExact() and PyCMethod_Check() for the new PyCMethod subtype. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide commentI would prefer to exclude PyCFunction_CheckExact() from the limited C API.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide commentI'm not so sure. We are changing the semantics of PyCFunction_Check() by adding a subtype that it covers. The macro is a part of the limited C-API and thus, the semantic change is a problem all by itself. Either we accept that, then we should add the "obvious" related CheckExact macro, also to the limited API. Or, we reject that change all together. I don't think the latter is an option, though.
Personally, I'd say, since it's a macro, it doesn't hurt, since it has no impact at all on the ABI. Everyone can safely copy and use that macro also on their side, so why not just add it?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide commentI will not hold this PR just for that. We can should PyCFunction_CheckExact() as it is in Python 3.9, and revisit the issue later. I created https://bugs.python.org/issue40601 to explain my concern: I plan to work on that in Python 3.10, it's too late for Python 3.9.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide commentDo note that PyCMethod is a bit of a hack in that PyCFunction is still not an "acceptable base type". You can't subclasstype(print), but static types happen to bypass the Py_TPFLAGS_BASETYPE check. This is one more thing to be resolved if we want all types can become heap types.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.