python-trio / trio-typing

Type hints for Trio and related projects
Other
27 stars 16 forks source link

Replace plugin.args_invariant_decorator_callback with use of ParamSpec #92

Closed oremanj closed 10 months ago

oremanj commented 10 months ago

Resolves #90, a regression that appeared with mypy 1.7. In order to have ParamSpec available, we now require at least mypy 1.0. args_invariant_decorator_callback is modeled off the mypy contextlib plugin which was replaced with use of ParamSpec in Oct 2022 (https://github.com/python/mypy/commit/3108669b0c1d57a6eecf84002fa1cf240449dba6); mypy 1.0 came out in Feb 2023.

The test described in #90 no longer fails now that this hook has been removed.

While we're here, update stubs to be consistent with Trio's new inline stubs to satisfy CI. This included:

oremanj commented 10 months ago

I solemnly swear that all of the statistics classes were copy-pasted from current trio. :-) stubtest is happy so I think there's relatively little that could be incorrect.