Skip to content

Conversation

@pablogsal
Copy link
Member

@pablogsal pablogsal commented Dec 6, 2025

⚠️ Dear reviewers, to avoid collapsing the GitHub API with a lot of comments, please open PRs against the base branch with any suggestions or fixes if you are sure are not controversial ⚠️


📚 Documentation preview 📚: https://cpython-previews--142351.org.readthedocs.build/

DinoV and others added 30 commits October 2, 2025 13:22
Highlight lazy imports in the new REPL
@python-cla-bot
Copy link

python-cla-bot bot commented Dec 15, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

brittanyrey and others added 6 commits December 15, 2025 10:45
* Update example to add missing import
* Add link to lazy keyword
* Update documentation
* PEP-7 for import.c

* re-order imports

* fix tests

* some final nits

* alter other file

* alter sysmodule.c
…ces,

and prefer using `//` for comments instead of `/* */`.
.. c:function:: int PyImport_SetLazyImportsMode(PyImport_LazyImportsMode mode)
Similar to :c:func:`PyImport_ImportModuleAttr`, but names are UTF-8 encoded
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-paste error? This seems unrelated to the function being described.


print('json' in sys.modules) # True - now loaded

If an error occurs during module loading (such as :exc:`ImportError` or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps also document that ImportCycleError may be raised?

1 LOAD_SMALL_INT 0
LOAD_CONST 1 (('*',))
IMPORT_NAME 0 (math)
IMPORT_NAME 2 (math + eager)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding more tests for the new logic in dis.py.

try:
lazy import os
except:
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about putting it in the except:?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a commit to address

lazy import within an except block. Also removed unused var.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.