summaryrefslogtreecommitdiffstats
path: root/Doc/reference/import.rst
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] Docs: Fix backtick errors found by sphinx-lint (GH-97998) (#98371)C.A.M. Gerlach2022-10-221-1/+1
| | | | | | | | | Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>. (cherry picked from commit fa2d43e5184f5eaf3391844ec2400342a1b2ead4) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* [3.11] gh-97850: Remove the open issues section from the import reference ↵Miss Islington (bot)2022-10-221-19/+0
| | | | | | | | | | | | | (GH-97935) (GH-97994) Remove the open issues section from the import reference Tracking in https://github.com/python/cpython/issues/97850 instead. (cherry picked from commit f8edc6ff531bb98858185857513371f14519ed1d) Co-authored-by: Brett Cannon <brett@python.org> Automerge-Triggered-By: GH:brettcannon
* gh-91181: drop support for bytes on sys.path (GH-31934)Miss Islington (bot)2022-07-171-4/+2
| | | | | | | | | Support for bytes broke sometime between Python 3.2 and 3.6 and has been broken ever since. Trying to bring back supports is surprisingly difficult in the face of -b and checking for keys in sys.path_importer_cache. Since the support was broken for so long, trying to overcome the difficulty of bringing back the support has been deemed not worth it. Co-authored-by: Eryk Sun <eryksun@gmail.com> Co-authored-by: Brett Cannon <brett@python.org> (cherry picked from commit 6da988a46c8955755624ad9878288d5214fceb4e) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* Docs: remove redundant "adverb-adjective" hyphens from compound modifiers ↵Miss Islington (bot)2022-07-051-1/+1
| | | | | | | | (GH-94551) (GH-94557) Discussion: https://discuss.python.org/t/slight-grammar-fix-throughout-adverbs-dont-need-hyphen/17021 (cherry picked from commit 3440d197a55800ecceea3e115e44b4262411359c) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* bpo-21761: Clarify __file__/__cached__ in import reference (GH-31565)slateny2022-04-261-4/+5
| | | Automerge-Triggered-By: GH:brettcannon
* gh-89885: Improve import example in language reference (#91523)slateny2022-04-171-6/+4
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Removed confusing reference to sys (GH-31638)David Gilbertson2022-03-081-3/+3
|
* [doc] Fix typos found using codespell (GH-28744)Christian Clauss2021-10-051-1/+1
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-39452: Rewrite and expand __main__.rst (#26883)Jack DeVries2021-08-241-0/+2
| | | | | | | Broadened scope of the document to explicitly discuss and differentiate between ``__main__.py`` in packages versus the ``__name__ == '__main__'`` expression (and the idioms that surround it), as well as ``import __main__``. Co-authored-by: Géry Ogam <gery.ogam@gmail.com> Co-authored-by: Éric Araujo <merwok@netwok.org> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-21760: fix __file__ description (GH-19097)Furkan Onder2021-06-091-3/+8
|
* bpo-43672: raise ImportWarning when calling find_loader() (GH-25119)Brett Cannon2021-04-021-1/+2
|
* bpo-42134: Raise ImportWarning when calling find_module() in the import ↵Brett Cannon2021-03-301-0/+11
| | | | system (GH-25044)
* bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)Brett Cannon2021-03-261-0/+7
|
* bpo-35181: Correct importlib documentation for some module attributes (GH-15190)Géry Ogam2020-10-211-15/+3
| | | | | | | | | | | | | | | @ericsnowcurrently This PR will change the following: In the library documentation importlib.rst: - `module.__package__` can be `module.__name__` for packages; - `spec.parent` can be `spec.__name__` for packages; - `spec.loader` is not `None` for namespaces packages. In the language documentation import.rst: - `spec.loader` is not `None` for namespace packages. Automerge-Triggered-By: GH:warsaw
* Doc: Fix a typo/error in the docs for cached bytecode (GH-22445)Zackery Spytz2020-10-211-1/+1
|
* Improve grammar in the import system reference documentation (GH-18209)Bonifacio de Oliveira2020-01-301-1/+1
| | | | | Replaced the period with a comma. Automerge-Triggered-By: @Mariatta
* links in importlib.metadata.rst replaced with sphinx references (GH-17730)Oleg Höfling2019-12-291-0/+2
| | | | | | | The importlib.metadata documentation uses hardcoded links to internal pages. This results in minor rendering issues. This change replaces the hardcoded links with suitable Sphinx roles. Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
* Fix minor typos. (GH-17095)Shu2019-11-131-3/+3
|
* Clarify amount of dots between package and subpackage (GH-17092)Shu2019-11-081-1/+1
|
* Namespace packages _bootstrap.ModuleSpec.loader attributes are no longer ↵Géry Ogam2019-05-011-6/+5
| | | | | | | | | None (#10376) Namespace packages _bootstrap.ModuleSpec.loader attributes are no longer `None` _after_ calling the importlib._bootstrap._init_module_attrs function. See: * https://stackoverflow.com/questions/52869541/namespace-package-spec-loader-and-loader-attributes-not-set-to-none * https://bugs.python.org/issue35181
* bpo-30840: Document relative imports (#12831)Joannah Nanjekye2019-04-241-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | * document relative imports * 📜🤖 Added by blurb_it. * fix indentation error * remove indentation * Document relative imports * Document relative imports * remove from ...package * Document relative imports * remove trailing space * Document relative imports * Document relative imports
* bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174)Serhiy Storchaka2018-12-191-3/+3
|
* Mark -c and -O as command line options in reStructuredText. (GH-10103)Andrés Delfino2018-11-071-1/+1
|
* bpo-35054: Add more index entries for symbols. (GH-10064)Serhiy Storchaka2018-10-261-2/+2
|
* Clarify that __path__ can't be just any value (GH-6554)Brett Cannon2018-04-201-2/+1
|
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-091-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | Python now supports checking bytecode cache up-to-dateness with a hash of the source contents rather than volatile source metadata. See the PEP for details. While a fairly straightforward idea, quite a lot of code had to be modified due to the pervasiveness of pyc implementation details in the codebase. Changes in this commit include: - The core changes to importlib to understand how to read, validate, and regenerate hash-based pycs. - Support for generating hash-based pycs in py_compile and compileall. - Modifications to our siphash implementation to support passing a custom key. We then expose it to importlib through _imp. - Updates to all places in the interpreter, standard library, and tests that manually generate or parse pyc files to grok the new format. - Support in the interpreter command line code for long options like --check-hash-based-pycs. - Tests and documentation for all of the above.
* Fix a grammatical problem and reword for clarity. (#4257)Barry Warsaw2017-11-031-5/+4
| | | bpo-31936
* bpo-31799: Make module.__spec__ more discoverable (#4010)Barry Warsaw2017-10-171-2/+3
| | | | bpo-31799: Make module.__spec__ more discoverable
* link to legacy doc on the non-legacy website (#3362)Benjamin Peterson2017-09-051-1/+1
|
* Improve grammar in The Import System documentation (GH-1862)kms708472017-05-301-6/+6
| | | | Replace `an ModuleNotFoundError` with `a ModuleNotFoundError`. Replace `an path` with `a path`.
* Fix ModuleNotFoundError typo in import reference (#1606)Dominik Miedziński2017-05-161-1/+1
|
* bpo-26184: import.rst: Improve versionchanged note (GH-325)Mariatta2017-02-261-1/+1
|
* bpo-26184: import.rst: Improve versionchanged note (GH-277)Mariatta2017-02-261-2/+5
| | | | Mention that an ImportError is raised when exec_module() is defined, but create_module() is not.
* bpo-29648: import.rst: Add reference to create_module() (GH-290)Marco Buttu2017-02-261-1/+1
| | | Add a reference to create_module(), in the first versionadded of section Loaders.
* Issue #15767: Use ModuleNotFoundError.Eric Snow2016-09-071-10/+10
|
* Merge for issue #27712Brett Cannon2016-08-121-2/+2
|\
| * Issue #27712: Fix some typos in the import docs.Brett Cannon2016-08-121-2/+2
| | | | | | | | Thanks to Xiang Zhang for the patch.
* | Issue #25791: Warn when __package__ != __spec__.parent.Brett Cannon2016-01-221-4/+14
| | | | | | | | | | | | | | | | | | In a previous change, __spec__.parent was prioritized over __package__. That is a backwards-compatibility break, but we do eventually want __spec__ to be the ground truth for module details. So this change reverts the change in semantics and instead raises an ImportWarning when __package__ != __spec__.parent to give people time to adjust to using spec objects.
* | Issue #25791: Raise an ImportWarning when __spec__ or __package__ areBrett Cannon2016-01-151-1/+2
|/ | | | | | | | not defined for a relative import. This is the start of work to try and clean up import semantics to rely more on a module's spec than on the myriad attributes that get set on a module. Thanks to Rose Ames for the patch.
* Issue #25500: Fix the language reference to not claim that importBrett Cannon2015-12-041-5/+4
| | | | | | statements search for __import__ in the global scope. Thanks to Sergei Lebedev for finding the documentation bug.
* Issue #24713: Use importlib.reload() in import reference document.Berker Peksag2015-07-251-1/+1
|\ | | | | | | | | | | | | imp.reload() was deprecated in Python 3.4 and changed to call importlib.reload(). Patch by Petr Viktorin.
| * Issue #24713: Use importlib.reload() in import reference document.Berker Peksag2015-07-251-1/+1
| | | | | | | | | | | | | | imp.reload() was deprecated in Python 3.4 and changed to call importlib.reload(). Patch by Petr Viktorin.
* | Issue #24029: Document the name binding behavior for submodule imports.Barry Warsaw2015-04-221-0/+35
|\ \ | |/
| * Issue #24029: Document the name binding behavior for submodule imports.Barry Warsaw2015-04-221-0/+35
| |
* | Issue #23731: Implement PEP 488.Brett Cannon2015-04-131-1/+1
| | | | | | | | | | | | The concept of .pyo files no longer exists. Now .pyc files have an optional `opt-` tag which specifies if any extra optimizations beyond the peepholer were applied.
* | Issue #23014: Make importlib.abc.Loader.create_module() required whenBrett Cannon2015-01-091-1/+7
| | | | | | | | | | | | | | | | | | importlib.abc.Loader.exec_module() is also defined. Before this change, create_module() was optional **and** could return None to trigger default semantics. This change now reduces the options for choosing default semantics to one and in the most backporting-friendly way (define create_module() to return None).
* | Issue #22834: Have import suppress FileNotFoundError when the currentBrett Cannon2014-11-211-0/+9
| | | | | | | | | | | | working directory no longer exists. Thanks to Martin Panter for the bug report.
* | Issue #22242: Try to make some import-related loader details clearer.Brett Cannon2014-11-071-1/+2
|/ | | | Thanks to Jon Poler for pointing this out.
* Fixing broken links in doc, part 3: the restGeorg Brandl2014-10-291-1/+1
|
* Use https:// URLs when referring to python.org hosts.Georg Brandl2014-10-291-1/+1
|