On Sun, Feb 14, 2021 at 12:51 PM David Mertz <mertz@gnosis.cx> wrote:
On Sun, Feb 14, 2021, 2:53 PM Gregory P. Smith <greg@krypto.org> wrote:TL;DR of my TL;DR - Not conveying bool-ness directly in the return annotation is my only complaint. A BoolTypeGuard spelling would alleviate that.
This is exactly my feeling as well. In fact, I do not understand why it cannot simply be a parameterized Bool. That would avoid all confusion. Yes, it's not the technical jargon type system designers use... But the existing proposal moves all the mental effort to non-experts who may never use type checking tools.
But note that 'bool' in Python is not subclassable.
No, but this hypothetical 'Bool'--presumably added to typing.py--might well be.
Cheers,
/arry