Fix type errors stemming from getattr (#9889)
Fixes #9888.
I applied the following patch to typeshed and ran self check:
```
+@overload
+def getattr(__o: Any, name: str, __default: None) -> Optional[Any]: ...
+@overload
def getattr(__o: Any, name: str, __default: Any = ...) -> Any: ...
```
Co-authored-by: hauntsaninja <>
Committer
Ivan Levkivskyi