Thanks for the feedback everyone. I've updated the language in the PEP to clear up some points that were raised.
I also fixed the bug in the code sample that Sebastian noted. It is not be necessary to wrap the result in a TypeGuard object. Any bool return result is fine.
There were questions about what happens when a type guard function is implemented as a method (instance or class). In this case, the value being tested is still the first argument of the bound method. It maps to the second parameter of the method — the one after the "self" or "cls" parameter.
I also clarified what I mean by " User-defined type guards apply narrowing only in the positive case (the if clause)." If that's still not clear, let me know.
Sebastian, you asked about "type assertions". For that use case, I recommend a different approach. The validation routine should return the typed value that it's validating and raise an exception if it doesn't match that type.
```python def validate_foo_json(j: Any) -> Foo: if xxx: raise RuntimeError() return cast(Foo, j)
def parse_foo_json_request(j: Any) -> None: validated_j = validate_foo_json(j) ```
Guido, I'm interested in your feedback on the PEP once you have a chance to review.