This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author corona10
Recipients corona10, gvanrossum, serhiy.storchaka, vstinner
Date 2020-04-23.13:01:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587646900.27.0.847071924511.issue40369@roundup.psfhosted.org>
In-reply-to
Content
> 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?
History
Date User Action Args
2020-04-23 13:01:40corona10setrecipients: + corona10, gvanrossum, vstinner, serhiy.storchaka
2020-04-23 13:01:40corona10setmessageid: <1587646900.27.0.847071924511.issue40369@roundup.psfhosted.org>
2020-04-23 13:01:40corona10linkissue40369 messages
2020-04-23 13:01:39corona10create