On this page
types.CapsuleType
Prev: types.BuiltinMethodType | Up: types | Next: types.CellType
Rel: types.AsyncGeneratorType, types.BuiltinFunctionType, types.BuiltinMethodType, types.CellType
Ref: docs.python.org — types.CapsuleType
Tags: #public #python3 #stdlib #types
Import
import types
from types import CapsuleType
Signature & Overview
types.CapsuleType()
Capsule objects let you wrap a C "void *" pointer in a Python object. They're a way of passing data through the Python interpreter without creating your own custom type.
Usage
import types
# Python 3.13+: type of C API PyCapsule objects (e.g. pyexpat.expat_CAPI)
assert hasattr(types, 'CapsuleType') or True
Gotchas
- Requires Python 3.13+.
REPL Inspect
from types import CapsuleType
help(CapsuleType)
Linked from
- tuts/python3/stdlib_module/types
- tuts/python3/stdlib_module/types/AsyncGeneratorType
- tuts/python3/stdlib_module/types/BuiltinFunctionType
- tuts/python3/stdlib_module/types/BuiltinMethodType
- tuts/python3/stdlib_module/types/CellType
- tuts/python3/stdlib_module/types/ClassMethodDescriptorType
- tuts/python3/stdlib_module/types/CodeType
- tuts/python3/stdlib_module/types/coroutine
- tuts/python3/stdlib_module/types/CoroutineType
- tuts/python3/stdlib_module/types/DynamicClassAttribute
- tuts/python3/stdlib_module/types/EllipsisType
- tuts/python3/stdlib_module/types/FrameType
- tuts/python3/stdlib_module/types/FunctionType
- tuts/python3/stdlib_module/types/GeneratorType
- tuts/python3/stdlib_module/types/GenericAlias
- tuts/python3/stdlib_module/types/get_original_bases
- tuts/python3/stdlib_module/types/GetSetDescriptorType
- tuts/python3/stdlib_module/types/LambdaType
- tuts/python3/stdlib_module/types/MappingProxyType
- tuts/python3/stdlib_module/types/MemberDescriptorType
- tuts/python3/stdlib_module/types/MethodDescriptorType
- tuts/python3/stdlib_module/types/MethodType
- tuts/python3/stdlib_module/types/new_class
- tuts/python3/stdlib_module/types/prepare_class
- tuts/python3/stdlib_module/types/resolve_bases
Related notes
- tuts/python3/stdlib_module/types/AsyncGeneratorType Linked here; links to this page; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/BuiltinFunctionType Linked here; links to this page; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/BuiltinMethodType Linked here; links to this page; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/CellType Linked here; links to this page; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/types/ClassMethodDescriptorType links to this page; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/CodeType links to this page; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/coroutine links to this page; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/CoroutineType links to this page; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/DynamicClassAttribute links to this page; shared tags: #stdlib, #types