<s>[INST] Here is my current code that selects the correct polygons:
```python
shapes = [shape for shape in layer if isinstance(shape, QgsVectorLayer) and shape.geometry().type() == QgsWkbTypes.PolygonGeometry]
```
However, it doesn't handle different types of polygon, like MultiPolygon and PolygonZ. QgsWkbTypes doesn't provide a method to check for "polygons in general". How can you do this?[/INST]