Any only works as an annotation:
In [3]: def fn(*argv: Any) -> Any:
...: return argv[0]
...:
From: Paul Bryan
from __future__ import annotations
Any
Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'Any' is not defined
On Mon, 2020-11-30 at 14:43 +0900, Inada Naoki wrote:
Since Python 3.10, you can use "Any" without "from typing import Any".
You can do it in Python 3.7 by "from __future__ import annotations" too.
See https://www.python.org/dev/peps/pep-0563/https://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.python.org%2Fdev%2Fpeps%2Fpep-0563%2F&data=04%7C01%7C%7Cf27001db4fda41a8422008d894f63854%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637423132705057013%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QKqmO0f%2BLE040QGySslUfYKGGjyVPIbqVndWLwLHEe4%3D&reserved=0
Regards,
On Mon, Nov 30, 2020 at 12:29 AM Abdulla Al Kathiri