BUG: Support array interface

This should fix #3390.
why not ``len(y)`` ?