8000 Make decorator more complicated (both b.deco and a.g are now deferred) · python/mypy@3357393 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3357393

Browse files
author
Guido van Rossum
committed
Make decorator more complicated (both b.deco and a.g are now deferred)
1 parent 331f845 commit 3357393

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test-data/unit/check-modules.test

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,15 +1280,17 @@ import a
12801280
[file a.py]
12811281
import b
12821282
def g() -> None:
1283-
f()
1283+
f('')
12841284
@b.deco
1285-
def f() -> int: pass
1285+
def f(a: str) -> int: pass
12861286
x = 1 + 1
12871287
[file b.py]
1288-
from typing import Any
1288+
from typing import Callable, TypeVar
12891289
import a
1290-
def deco(f: Any) -> Any:
1290+
T = TypeVar('T')
1291+
def deco(f: Callable[[T], int]) -> Callable[[T], int]:
12911292
a.x
1293+
return f
12921294

12931295

12941296
-- Scripts and __main__

0 commit comments

Comments
 (0)
0