Message367107
> Do you have any realistic example which would benefit from speeding up the creation of GenericAlias instances?
Hmm I did not find loop tightly calling case, but
for example, this kinds of usage are very often.
def create_q(l: list[int]) -> Queue[int]:
q = Queue[int]()
for e in l:
q.put(e)
return q
a = create_q([1,2,3,4,5])
In this code, GenericAlias is called 2 times for function declare and function call.
It's true that GenericAlias has a small portion in this scenario,
but wouldn't it be worth it if we could optimize itself to a few lines of code? |
|
Date |
User |
Action |
Args |
2020-04-23 13:01:40 | corona10 | set | recipients:
+ corona10, gvanrossum, vstinner, serhiy.storchaka |
2020-04-23 13:01:40 | corona10 | set | messageid: <1587646900.27.0.847071924511.issue40369@roundup.psfhosted.org> |
2020-04-23 13:01:40 | corona10 | link | issue40369 messages |
2020-04-23 13:01:39 | corona10 | create | |
|