fields.buffers.base.BufferBase.can_handle#
- classmethod BufferBase.can_handle(obj: Any) bool [source]#
Return
True
if obj can be wrapped by this buffer class.The test is simply
isinstance(obj, t)
for at least one t in__can_resolve__
. Subclasses should set__can_resolve__
to either:a single type (e.g.
np.ndarray
), oran iterable/tuple of types (e.g.
(np.ndarray, np.ma.MaskedArray)
).
If a subclass leaves
__can_resolve__
asNotImplemented
the method always returnsFalse
so the registry can skip it.