replace range -> xrange in polytope
replace len(poly) > 0 check by isinstance(poly, Region)