Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions stdlib/@tests/test_cases/builtins/check_callable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# mypy: disable-error-code="no-any-return"

from typing import Any


def check_gradual_guarantee(arg: Any) -> int:
# if Any materialized to `Callable[[], int] | None`, this function type checks
if callable(arg):
return arg()
return -1
2 changes: 1 addition & 1 deletion stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ else:
def bin(number: SupportsIndex, /) -> str: ...

def breakpoint(*args: Any, **kws: Any) -> None: ...
def callable(obj: object, /) -> TypeIs[Callable[..., object]]: ...
def callable(obj: object, /) -> TypeIs[Callable[..., Any]]: ...
def chr(i: SupportsIndex, /) -> str: ...
def aiter(async_iterable: SupportsAiter[_SupportsAnextT_co], /) -> _SupportsAnextT_co: ...

Expand Down
Loading