use dshape in typeof
Fix dshape constructor to accept unicode in python 2