ref https://github.com/python/typeshed/pull/10485#issuecomment-1643745094 (Any contributions welcome, it's not needed to cover everything in one pull request)