gh-117865: Speedup import of `inspect` module (#144756) · python/cpython@ea90b03 · GitHub
Skip to content

Commit ea90b03

Browse files
gh-117865: Speedup import of inspect module (#144756)
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
1 parent 46c5c57 commit ea90b03

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

Lib/inspect.py

Lines changed: 4 additions & 4 deletions

Lib/test/test_inspect/test_inspect.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,15 @@ def __get__(self, instance, owner):
173173
return self.func.__get__(instance, owner)
174174

175175

176+
class TestImportTime(unittest.TestCase):
177+
178+
@cpython_only
179+
def test_lazy_import(self):
180+
import_helper.ensure_lazy_imports(
181+
"inspect", {"re", "tokenize"}
182+
)
183+
184+
176185
class TestPredicates(IsTestBase):
177186

178187
def test_excluding_predicates(self):
Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)