OK, so `FunctionGraph.attach_feature` has the following code:
```Python
        # Filter out functionally identical features.
        # Features may use their on_attach method to raise
        # toolbox.AlreadyThere if they detect that some
        # installed feature does the same thing already
        attach = getattr(feature, 'on_attach', None)
        if attach is not None:
            try:
                attach(self)
            except toolbox.AlreadyThere:
                return
```
So if `ShapeFeature.on_attach` raises `toolbox.AlreadyThere` instead of `AssertionError`, it would also prevent multiple `ShapeFeature` instances from being attached.
I'm not sure what is better, your solution has the advantage of not instantiating `ShapeFeature()` for nothing. I was just thinking there's already a mechanism in place to do that, why not use it? We could also do both.