[issue46963] Deep Lazy Imports - Interpreter-level deferred module loading

2022-03-08 Thread Germán Méndez Bravo
New submission from Germán Méndez Bravo : As the size of a Python project increases, the number of modules and the complexity of its dependencies increases too, producing two problems in large codebases: increased risk of import cycles and slow start times due to the number of modules that

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-07-04 Thread Germán Méndez Bravo
Germán Méndez Bravo added the comment: I added a pull request with my fix here: https://github.com/python/cpython/pull/27017 -- ___ Python tracker <https://bugs.python.org/issue41

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-07-04 Thread Germán Méndez Bravo
Change by Germán Méndez Bravo : -- keywords: +patch pull_requests: +25576 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27017 ___ Python tracker <https://bugs.python.org/issu

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-07-03 Thread Germán Méndez Bravo
Germán Méndez Bravo added the comment: Nils, unfortunately, fixing the MRO here won’t fix the issue because `TypedDict.__annotations__` in the class copies the annotations from the parent classes, and when the type evaluation is made, it’s made using the copied annotation found in the

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-07-03 Thread Germán Méndez Bravo
Germán Méndez Bravo added the comment: The way I fixed this is I added `__forward_module__` to `typing.ForwardRef`, so that it can resolve the forward reference with the same globals as the ones specified by the module in `__forward_module__`. `TypedDict`'s metaclass should then pas

[issue43392] Optimize repeated calls to `__import__()`

2021-03-03 Thread Germán Méndez Bravo
Change by Germán Méndez Bravo : -- keywords: +patch pull_requests: +23506 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24735 ___ Python tracker <https://bugs.python.org/issu

[issue43392] Optimize repeated calls to `__import__()`

2021-03-03 Thread Germán Méndez Bravo
New submission from Germán Méndez Bravo : A call to `importlib.__import__()` normally locks the import for the module being worked on; this, however has a performance impact for modules that are already imported and fully initialized. An example of this are inline `__import__()` calls in a