use `w_perm is space.w_nil`, not `isinstance(w_perm, W_NilObject)`