Hacker News new | ask | show | jobs
by tandav 997 days ago
I wish they make it possible to use any, callable builtins for type annotations
1 comments

You can.

def foobar(things: list[tuple[int, Floob | None]]) -> dict[int, int]):

Possible since 3.11 I think, maybe even 3.10.

I think they mean the literal builtins `any` and `callable` instead of typing.Any and typing.Callable.
You can use it since 3.7 with `from __future__ import annotations`