Verifique se o objeto é matriz como Python

if hasattr(N, "__len__")
Real Raccoon