We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
def f(fn: Callable[[int], int]):... f(lambda i: i) # no error, int @f def foo(i): # error return i # Unknown
from typing import Callable from basedtyping import P, T def copy_signature(fn: Callable[P, T]) -> Callable[[Callable[P, T]], Callable[P, T]]: ... def f(a: int) -> str: return str(a) @copy_signature(f) def g(a): reveal_type(a) # Unknown return "" reveal_type(g) # (int) -> str
The function should act like a lambda here and infer the types of the parameters from the surrounding context
copy_signature(f, lambda a: "") # correctly infers
The text was updated successfully, but these errors were encountered:
ContextManager[None]
contextlib.contextmanger
No branches or pull requests
real life:
The function should act like a lambda here and infer the types of the parameters from the surrounding context
The text was updated successfully, but these errors were encountered: