summaryrefslogtreecommitdiffstats
path: root/Doc/reference/import.rst
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Issue #19697: document more __main__.__spec__ quirksNick Coghlan2014-03-291-2/+16
|
* Issue #19697: Document cases where __main__.__spec__ is None.Eric Snow2014-03-291-1/+41
|
* Regenerated pydoc/topics.py, and fix a "suspicious" doc error.Larry Hastings2014-01-051-1/+1
|
* Removed spaces before commas and periods.Serhiy Storchaka2013-12-231-1/+1
|\
* | Issue #19713: Fix mistakes in the import page of language reference.Eric Snow2013-12-171-102/+118
| | | | | | | | These mistakes were introduced by the initial PEP 451 merge.
* | Fix a few markup problems in the new import doc.Georg Brandl2013-11-241-2/+4
| |
* | Implement PEP 451 (ModuleSpec).Eric Snow2013-11-221-146/+309
| |
* | Issue #15767: Revert 3a50025f1900 for ModuleNotFoundErrorBrett Cannon2013-07-041-6/+6
| |
* | Issue #15767: Touch up ModuleNotFoundError usage by import.Brett Cannon2013-06-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Forgot to raise ModuleNotFoundError when None is found in sys.modules. This led to introducing the C function PyErr_SetImportErrorSubclass() to make setting ModuleNotFoundError easier. Also updated the reference docs to mention ModuleNotFoundError appropriately. Updated the docs for ModuleNotFoundError to mention the None in sys.modules case. Lastly, it was noticed that PyErr_SetImportError() was not setting an exception when returning None in one case. That issue is now fixed.
* | mergeBrett Cannon2013-05-251-1/+5
|\ \ | |/
| * Mention __cached__ in the import ref.Brett Cannon2013-05-251-1/+5
| |
* | #17115,17116: Have modules initialize the __package__ and __loader__Brett Cannon2013-05-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attributes to None. The long-term goal is for people to be able to rely on these attributes existing and checking for None to see if they have been set. Since import itself sets these attributes when a loader does not the only instances when the attributes are None are from someone overloading __import__() and not using a loader or someone creating a module from scratch. This patch also unifies module initialization. Before you could have different attributes with default values depending on how the module object was created. Now the only way to not get the same default set of attributes is to circumvent initialization by calling ModuleType.__new__() directly.
* | Merge with 3.3.Georg Brandl2013-03-281-2/+1
|\ \ | |/
| * Closes #4159: add LaTeX tabular column specifications to tables that ↵Georg Brandl2013-03-281-2/+1
| | | | | | | | otherwise are cut off or have overlapping text.
* | Issue #17117: Have both import itself and importlib.util.set_loader()Brett Cannon2013-03-131-7/+9
|/ | | | | | set __loader__ on a module when set to None. Thanks to Gökcen Eraslan for the fix.
* - Issue #16514: Fix regression causing a traceback when sys.path[0] is NoneBarry Warsaw2012-11-201-9/+15
| | | | (actually, any non-string or non-bytes type).
* Issue #16144: Fix misleading sentence in reference/import.Andrew Svetlov2012-11-151-5/+5
| | | | Patch by Manuel Pégourié-Gonnard
* s/path importer/path based finder/ (because the path based finder is not an ↵Nick Coghlan2012-08-201-46/+51
| | | | importer and the simpler 'path finder' is too ambiguous)
* Fix markup errors and update pydoc topics.Georg Brandl2012-08-111-1/+1
|