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), or

  • an iterable/tuple of types (e.g. (np.ndarray, np.ma.MaskedArray)).

If a subclass leaves __can_resolve__ as NotImplemented the method always returns False so the registry can skip it.