|
class _LazyAnnotationLib: |
|
def __getattr__(self, attr): |
|
global _lazy_annotationlib |
|
import annotationlib |
|
_lazy_annotationlib = annotationlib |
|
return getattr(annotationlib, attr) |
|
|
|
_lazy_annotationlib = _LazyAnnotationLib() |
It is a perfect candidate for the refactoring.
Linked PRs
cpython/Lib/typing.py
Lines 166 to 173 in ffb543d
It is a perfect candidate for the refactoring.
Linked PRs
typing._LazyAnnotationLibwithlazy import#149416