See https://github.com/python/typeshed/pull/6585. There are two problems: * pytype chokes on `from ... import X` thanks to https://github.com/google/pytype/blob/002b88cf8e0254fbd73fa0277800ec1d0c4e9a99/pytype/pyi/parser.py#L61. * nested class issues: https://github.com/python/typeshed/pull/6585/commits/c1fe447505ac4303d1eea51374a49d89a65890c1