Alex Waygood

Results 861 comments of Alex Waygood

> And I think that magic methods are meant to be reserved for python-level magic, not something custom. That's how they're _meant_ to be used, for sure, but third-party libraries...

We'd rather not make these changes until the various runtime libraries have cut releases which have the `__nonzero__` methods removed. And when there are releases with the `__nonzero__` methods removed,...

Closing due to lack of response from OP

Alternatively, we could have a single command-line argument, `--dir`. Running only on the stdlib would be `--dir stdlib`, etc.

I'm actually somewhat inclined to remove the `--verbose` and `--dry-run` options as well. I've never found them useful (but I'm happy to keep them if somebody else has).

> Unrelated: I would prefer not to test our own scripts in mypy_test. Instead we should have a separate step in CI and just manually call mypy. In my view,...

> I'm fine with changing `exclude` and `filter`. The approach I find most intuitive was to just run `mypy_test stdlib/foo.pyi` or `mypy_test stubs/bar` to test a specific file or directory....

Arguably the [mypy docs](https://mypy.readthedocs.io/en/stable/kinds_of_types.html#generators) would also have to be updated: > A basic generator that only yields values can be succinctly annotated as having a return type of either `Iterator[YieldType]` ...

^I started typing out a response, but (as is so often the case) @JelleZijlstra beat me to it, and I agree with everything he said :)

It's a shame we don't have something like the following construct in `typing.py`: ```python _T_co = TypeVar("_T_co", covariant=True) SimpleGenerator = Generator[_T_co, None, None] ``` Returning `SimpleGenerator[_T_co]` from these functions would...