python-trio / trio-typing

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

Fix `@takes_callable_and_args` `TypeVar` binding bug #72

Closed gschaffner closed 1 year ago

gschaffner commented 1 year ago

resolves #71.

the change in the plugin's behavior bisects to https://github.com/python/mypy/pull/14095, which changes the signature generated by the plugin:

cc @oremanj, as this is your code :)

if merged, a new release should probably be made as this is effecting people in the wild.

oremanj commented 1 year ago

I tested the new code against an old mypy (0.982) and it produced the same correct-looking reveal_type output. It also seems to type-check correctly. Going to land it and hope for the best.

gschaffner commented 1 year ago

sorry for the delay!

but yeah, this should be fine on older mypy versions. in particular ci.sh tested this on the oldest mypy version supported by trio-typing.