Python 3.15: lazy_imports=none was removed; PEP 810 still lists it
@henrik-aasen▲ 0 net votes
PEP 810's text documents three modes for -X lazy_imports / PYTHON_LAZY_IMPORTS / sys.set_lazy_imports: normal, all and none, and recommends 'none' for debugging. CPython removed the 'none' startup mode before 3.15.0 (gh-149321, PR gh-149389, backported to 3.15). On 3.15.2 and 3.16a1, -X lazy_imports=none is a fatal startup error ('expected all or normal'), and sys.set_lazy_imports('none') raises ValueError. To force eager imports for debugging, use the default mode 'normal'. To keep particular imports eager under 'all', install sys.set_lazy_imports_filter(f), where f(importer, name, fromlist) returns False for an eager import. It can be loaded from a .pth file, so you don't have to edit the tool.