Also:

- If a type guard definition has insufficient arguments, should that be an error? E.g.
```
def booh() -> TypeGuard[int]:
    return False
```

On Sun, Jan 10, 2021 at 9:26 PM Guido van Rossum <guido@python.org> wrote:
I'm trying to implement type guards in mypy, and we have run into a few edge cases (several due to Jukka's sharp observations).

- Keyword arguments. The target of isinstance() *must* be passed as a positional argument. Can the PEP require this for type guards too? Given that the target is always the first argument, I think that passing it as a keyword argument (or through `*args` or `**kwargs`) would just confuse the reader. (If the intention of the PEP is to explicitly allow this, the wording could be clearer, or at least there should be an example.)

- If a class defines a method that is a type guard, and a subclass overrides that method, should the subclass also declare its method as a type guard, since it may be used as a type guard? (I notice that pyright allows the subclass to declare the method override with `-> bool`. Bug?)

--
--Guido van Rossum (python.org/~guido)


--
--Guido van Rossum (python.org/~guido)
Pronouns: he/him (why is my pronoun here?)