Well, there are some exceptions. E.g. type aliases are still evaluated:

# Python 3.10
TT = tuple[int, Any]

Similarly, casts:

f(cast(Any, arg))

And subclassing from generic classes, e.g.

T = TypeVar("T")
class B(Generic[T]): ...

class C(B[Any]): ...

Probably some that I forgot.

On Sun, Nov 29, 2020 at 9:43 PM Inada Naoki <songofaca...@gmail.com> 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/
>
> Regards,
>
> On Mon, Nov 30, 2020 at 12:29 AM Abdulla Al Kathiri
> <alkathiri.abdu...@gmail.com> wrote:
> >
> > Instead of importing “Any" from the typing module, we can annotate our
> functions with “Any" right away without the extra step. What do you think?
> We have the builtin function “any” which some Python users could
> mistakingly use, but static type checkers should catch that.
> > _______________________________________________
> > Python-ideas mailing list -- python-ideas@python.org
> > To unsubscribe send an email to python-ideas-le...@python.org
> > https://mail.python.org/mailman3/lists/python-ideas.python.org/
> > Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/ELI474TKP2OKHP4NW5HOVUPKDPLYE2JP/
> > Code of Conduct: http://python.org/psf/codeofconduct/
>
>
>
> --
> Inada Naoki  <songofaca...@gmail.com>
> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/VENGRL6T54XQUYDXONZRZE7LUCO6MKWI/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/S6BZGCRSLMK4GY4ZA5T4SGG4BR3FS3XC/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to