Hacker News new | ask | show | jobs
by kuratkull 997 days ago
You can.

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

Possible since 3.11 I think, maybe even 3.10.

2 comments

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`