Typed code could be useful here. Wouldn't need the types-retry package in that case. Would also need a `py.typed` file. https://github.com/python/typeshed/tree/master/stubs/retry