-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
softagram/mypy
#2Labels
Description
Here's a simple example:
from __future__ import annotations
from typing import Callable
def decorator(method: Callable[[Foo], None]) -> Callable[[Foo], None]:
return method
class Foo():
@decorator
def __init__(self):
pass
reveal_type(Foo.__init__)
The output of mypy is:
% mypy --version
mypy 0.620
% mypy foo.py
foo.py:13: error: Revealed type is 'Any'
This seems to be specific to methods as similar type inferences work fine for functions outside of the class scope.