Ok, this worked for me:
print ('type = ', type(poly))
outputs from:
type = <class 'shapely.geometry.polygon.Polygon'>
in the case of a polygon and:
type = <class 'shapely.geometry.multipolygon.MultiPolygon'>
in case of multipolygon.
To check if a variable is a polygon or a polygon, I did this:
if (isinstance(poly, shapely.geometry.multipolygon.MultiPolygon)): code...
source share