fields.buffers.registry.BufferRegistry.get_buffer_class#
- BufferRegistry.get_buffer_class(array_like: Any) Type[BufferBase] [source]#
Identify the appropriate buffer class for a given array-like object.
This method searches through the registry to find a buffer class that can handle the input object. It does not instantiate the buffer or coerce the input—only returns the class that would be used to handle it.
This is useful for introspection, dispatch logic, or diagnostics when you need to know which buffer backend will be selected without actually creating the buffer.
- Parameters:
array_like (
Any
) – An object to test against registered buffer classes.- Returns:
The buffer class that can handle the input.
- Return type:
Type[BufferBase]
- Raises:
TypeError – If no registered buffer class can handle the input.