Quite often you iterate over the shapes of the space, or maybe you get a shape out from a arbiter, and then you need to fetch the body of the shape. In these cases you know for sure that the body is set, because a shape cannot be added to a space unless it has a body which is also added to the space. But the type checked doesn't know this and will warn that it might be None.
space = pymunk.Space()
for shape in space.shapes
position = shape.body.position # type error here since I didnt assert body is not None.
Is there some smarter way to handle this to reduce the useless asserts?