-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Expose capsule type in types module #109599
New issue
Have 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
Comments
This came up initially in #109562 |
What is the use case? AFAIK capsule objects are never used in the Python API. They are used in the C API, so perhaps From user's point of view the only difference of capsule type from Not every builtin type is exposed in types module. |
The use case is introspection, as with other types in the Also, please take a look at the issue I mentioned above, where the context is explained in a bit more detail: #109562 |
How can it help in introspection? What can you do with a capsule object in Python? The same argument can be applied to list_iterator. I am against cluttering types module. |
Again, the problem I'm trying to solve is explained in the #109562 issue description. You don't have to understand or care about that problem, but then please don't throw around dismissive opinions such as "I'm against cluttering X". This is unhelpful and hostile. |
I'm sorry that I was categorical. This is just my personal opinion and you are free to ignore it. But I hope that you will consider other options for solving your problem. Cluttering the types module has disadvantages. |
I would support adding this type. None and NotImplemented also have no Python-visible API to speak of, and yet we added |
--------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
--------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
It looks to me this was implemented; can we close this, @pitrou? |
Yes, sorry. I always forget that merging a PR does not automatically close the associated issue. |
--------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Feature or enhancement
Proposal:
It would be nice if the type of capsule objects was exposed in the
types
module, just like other interpreter types.Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
CapsuleType
via the_types
module #131969The text was updated successfully, but these errors were encountered: