[math] Set DimFilter docstring
@@ -957,8 +957,7 @@ EMPTY_SHAPE = Shape((), (), (), ())
""" Empty shape, `()` """
DimFilter = Union[str, tuple, list, Shape, Callable]
-"""
-Dimension filters can be used with `Shape.only()` and `Shype.without()`, making them the standard tool for specifying sets of dimensions.
+DimFilter.__doc__ = """Dimension filters can be used with `Shape.only()` and `Shype.without()`, making them the standard tool for specifying sets of dimensions.
The following types can be used as dimension filters:
@@ -966,7 +965,7 @@ The following types can be used as dimension filters:
* `tuple` or `list` objects containing dimension names as `str`
* Single `str` listing comma-separated dimension names
* Any function `filter(Shape) -> Shape`, such as `math.batch()`, `math.non_batch()`, `math.spatial()`, etc.
-"""
+""" # docstring must be set explicitly
class IncompatibleShapes(ValueError):
