Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

> Yeah I noticed it re-lookups __module__ unnecessarily multiple times for the 
> same type.

Actually I thought about this change, but did not implement it. Because it does 
not look performance critical, and future versions will likely do different 
tests (for example, testing the existence of special attribute, or check 
against lazily imported and cached classes from the typing module). Also, the 
test for TypeVar can be shared between genericaliasobject.c and unionobject.c.

It is mostly simple clean up, a line here, two lines there. 
genericaliasobject.c and unionobject.c could be merged in a single file, 
because they share several functions not used anywhere more. We perhaps merge 
them if more C implementations for typing be added in future.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44654>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to