[Python-Dev] Re: Type annotations, PEP 649 and PEP 563

2021-10-26 Thread Bluenix
> * Functions having the same signature share the same annotation tuple. Is this true with code that have a mutable default? >>> def a(arg = []): ... arg.append('a') ... return arg ... >>> def b(arg = []): ... arg.append('b') ... return arg ... >>> a() ['a'] >>> a() ['a', 'a']

[Python-Dev] Re: Type annotations, PEP 649 and PEP 563

2021-10-23 Thread Bluenix
Hmm, I thought I responded to this on Gmail but it hasn't appeared here on the archive so I'll send it again.. Is it known how much more/less the annotations impact performance compared to function defaults? -- Blue ___ Python-Dev mailing list --

[Python-Dev] Re: Type annotations, PEP 649 and PEP 563

2021-10-22 Thread Bluenix
Hello! > This would affect code that expects annotations to always be strings, but such > code would have to be poking directly at function objects (the > __annotations__ attribute), instead of using the advertised ways of getting > at annotations (like typing.get_type_hints()). I would

[Python-Dev] Re: In support of PEP 649

2021-04-15 Thread Bluenix
Please accept PEP 649! Python's type hinting has become so much more useful than originally thought, and without this change much of that will be hindered. For example (you already know about Pydantic and FastAPI) [discord.py](https://github.com/Rapptz/discord.py)'s commands system allows you