Sebastian Rittau
Sebastian Rittau
I don't think we'll get a consensus here, so I'm closing this in favor of the status quo.
I've reverted #12939, because as Jelle pointed out, `SupportsBool` is equivalent to `object` (as every object implements `__bool__` via object).
So ... is there a way to make stubtest ignore this error? (And why does stubtest even care about it?)
Maybe we could split the third-party changes out. I think they are worthwhile, whether we change `contextmanager` or not. (Although looking at the primer output, "not" seems like the better...
Also, @graingert's [comment](https://github.com/python/typeshed/issues/2772#issuecomment-871438097) from the original thread seems worthwhile, although I doubt it will help with the primer hits.
From the Changelog: > In API mode, when you get a function from a C library by writing fn = lib.myfunc, you get an object of a special type for...
Fixed by #13653.
I/O types are a mess, which is why we're moving more into tight protocols for arguments as used in `hashlib`. I think your analysis is correct. In fact, `file_digest` *can't*...
I blame my the heat and my tiredness for overlooking this quite obvious code path ... That said, I'd be interested in which situation `FileIO` works with non-blocking I/O. One...
In fact, `file_digest` is [explicitly documented](https://docs.python.org/3/library/hashlib.html#hashlib.file_digest) as taking a `SocketIO` object. And that can very much return `None`: https://github.com/python/cpython/blob/2a5d1eb7073179a13159bce937afdbe240432e7d/Lib/socket.py#L713