-
-
Notifications
You must be signed in to change notification settings - Fork 654
Open
Description
pyflakes
does not know about lazy_import
and may therefore emit distracting warnings - as noted in #30616 comment:8
We introduce a new method PythonModule.lazy_import
, which enables the following new idiom for creating lazy imports that are visible to static checkers:
LibBraiding = PythonModule('sage.libs.braiding', spkg='libbraiding')
rightnormalform = LibBraiding.lazy_import(
'rightnormalform', namespace=None)
centralizer, supersummitset = LibBraiding.lazy_import(
('centralizer', 'supersummitset'), namespace=None)
See also:
- New LazyImport implementation based on lazy_object_proxy #22793 New
LazyImport
implementation based onlazy_object_proxy
- Enable setting attributes on a lazy imported object #25898 Enable setting attributes on a lazy imported object
Depends on #30616
CC: @dcoudert @tobiasdiez @fchapoton @jhpalmieri @tscrim
Component: refactoring
Author: Matthias Koeppe
Branch/Commit: u/mkoeppe/make_lazy_import_more_friendly_to_pyflakes_and_other_static_checkers @ 9b19c7a
Issue created by migration from https://trac.sagemath.org/ticket/30647