Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-104212: Explain how to port imp.load_source() #105951

Closed
wants to merge 2 commits into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 20, 2023

Explain how to port removed imp "load" functions to Python 3.13 in What's New in Python 3.12.


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

Explain how to port removed imp "load" functions to Python 3.13 in
What's New in Python 3.12.
@brettcannon brettcannon self-requested a review June 20, 2023 23:31
@vstinner
Copy link
Member Author

vstinner commented Jun 21, 2023

I'm not comfortable to add such wall of text just to update code using imp in What's New in Python 3.12. I'm not convinced that init_builtin() or load_dynamic() are commonly used. These functions are more like internal functions used by the imp.load_module() function.

Moreover, I'm not sure how find_module() was used with load_module() to load modules. Is the use case to specify a search path which is not in sys.path? Why not putting the path in sys.path and simply use importlib.import_module()?

But I still consider that imp.load_source() is different and remains a relevant use case on its own. So I proposed PR #105978 to just document a recipe to replace this one.

@vstinner vstinner closed this Jun 21, 2023
@vstinner vstinner deleted the load_source_doc branch June 21, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir needs backport to 3.12 bug and security fixes skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants