Is there a reason you changed from using ``isinstance`` to checking the ``type``? ``isinstance`` is preferable because we want this to work for ``ndarray`` sub-classes as well (same for ``list``).