Skip to content

Replace typing._LazyAnnotationLib with lazy import #149415

@sobolevn

Description

@sobolevn

cpython/Lib/typing.py

Lines 166 to 173 in ffb543d

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

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytopic-typingtype-refactorCode refactoring (with no changes in behavior)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions