Backport PR #39202 on branch 1.2.x
Thanks @twoertwein 1.2.x is on mypy 0.782 so will need a fixup should be fixed now. Sorry, I didn't see that you were already working on back-porting it! Thanks @twoertwein 