Árni Már Jónsson

Results 14 comments of Árni Már Jónsson

This should do it: ```shell $ more mypy.ini [mypy] plugins = crochet.mypy $ cat wait_for_it.py import crochet @crochet.wait_for(10) async def foo() -> str: return '' def bar() -> str: return...

The stub for `wait_for` may need to change as well, I guess something like: ```python @overload def wait_for(timeout: float) -> Callable[[Callable[..., Coroutine[Any, Any, _T]]], _T]: ... @overload def wait_for(timeout: float)...

I attempted to update the plugin with limited results. I did discover that the annotation for `wait_for` needs to be: ```python @overload def wait_for(timeout: float) -> Callable[[Callable[..., Coroutine[Any, Any, _T]]],...

Hi again @itamarst, I was playing around with the new `ParamSpec` support in `mypy==0.950` and had success with this: ```python ... from typing_extensions import ParamSpec ... @overload def wait_for(timeout: float)...

> Happy to accept a PR, I don't have a lot of time to spend on writing this myself. I started a test-bed at https://github.com/itamarst/crochet/pull/144

Looks like we have to wait for https://github.com/python/mypy/issues/12595 though... I managed to get this to work well: ```python @overload def wait_for_x(f: Callable[_P, Deferred[_T]]) -> Callable[_P, _T]: ... @overload def wait_for_x(f:...

I've been doing this in my tests: ``` import werkzeug.wrappers Response = werkzeug.wrappers.Response werkzeug.wrappers.BaseResponse = Response # type: ignore[attr-defined] ``` ...and doing it before I import `httpbin` (I've been running...

Hi. You should be able to use the (default off) flag `--check-inside-f-strings` to make this work.

You are right. I have an experimental branch over at https://github.com/zheller/flake8-quotes/pull/120. I'll investigate in depth a bit later.

Having used `typeguard` with excellent results I've gained a healthy respect for runtime type-checking in Python. This then made me highly suspicious with the claims in `beartype` that it could...