summaryrefslogtreecommitdiffstats
path: root/Doc/library/importlib.rst
Commit message (Collapse)AuthorAgeFilesLines
* Issue #18278: properly document how the loaders are called for FileFinderBrett Cannon2013-06-211-0/+2
|
* Fix a misnaming of a method and an argumentBrett Cannon2013-06-161-1/+1
|
* Various tweaks to importlib docs.Brett Cannon2013-05-251-3/+8
|
* Issue #17357: Use more stern wording forBrett Cannon2013-04-281-5/+5
| | | | importlib.invalidate_caches().
* Issue #17215: Fix documentation misprints (patch by July Tikhonov)Andrew Svetlov2013-02-171-1/+1
|
* Issue #16489: Make it clearer that importlib.find_loader() requiresBrett Cannon2012-11-171-5/+4
| | | | the user to import any parent packages.
* Fix typo.Ezio Melotti2012-10-211-1/+1
|
* Issue #15640: Document importlib.abc.Finder as deprecated.Brett Cannon2012-08-171-24/+25
| | | | | | | The code for the class itself isn't deprecated for backwards-compatibility reasons, but the class shouldn't be directly inherited by anyone anymore as the API is no longer as widely valid as it used to be.
* Merge #15543: glossary entry for and 'universal newlines', and links to it.R David Murray2012-08-151-3/+7
|\ | | | | | | Patch by Chris Jerdonek.
| * #15543: reflow paragraphs.R David Murray2012-08-151-4/+3
| |
| * #15543: glossary entry for and 'universal newlines', and links to it.R David Murray2012-08-151-1/+6
| | | | | | | | Patch by Chris Jerdonek.
* | Push importlib ABC hierarchy chart.Andrew Svetlov2012-08-131-0/+15
| |
* | Minor doc formatting cleanup.Brett Cannon2012-08-111-3/+3
| |
* | Issue #15576: Allow extension modules to be a package's __init__Brett Cannon2012-08-101-4/+4
| | | | | | | | | | module again. Also took the opportunity to stop accidentally exporting _imp.extension_suffixes() as public.
* | Issue #15502: Finish bringing importlib.abc in line with the currentBrett Cannon2012-08-101-22/+46
| | | | | | | | | | | | | | | | | | state of the import system. Also make importlib.invalidate_caches() work with sys.meta_path instead of sys.path_importer_cache to completely separate the path-based import system from the overall import system. Patch by Eric Snow.
* | Issue #15471: Don't use mutable object as default values for theBrett Cannon2012-08-061-1/+1
| | | | | | | | parameters of importlib.__import__().
* | Update the What's New details for importlib based on doc/ABC changes.Brett Cannon2012-08-021-4/+6
| |
* | Ditch the 'self' argument in importlib docs since it's implied.Brett Cannon2012-08-021-8/+8
| |
* | Issue #15502: Bring the importlib.PathFinder docs and docstring more in line ↵Nick Coghlan2012-08-021-10/+5
| | | | | | | | with the new import system documentation, and fix various parts of the new docs that weren't quite right given PEP 420 or were otherwise a bit misleading. Also note the key terminology problem still being discussed in the issue
* | Close #15519: Properly expose WindowsRegistryFinder in importlib and bring ↵Nick Coghlan2012-08-021-0/+11
| | | | | | | | the name into line with normal import terminology. Original patch by Eric Snow
* | Issue #15502: Bring the importlib ABCs into line with the current state of ↵Nick Coghlan2012-08-021-26/+43
| | | | | | | | the import protocols given PEP 420. Original patch by Eric Snow.
* | Integration of importdocs from the features/pep-420 repo.Barry Warsaw2012-07-291-6/+21
| |
* | Fix importlib.machinery.all_suffixes docsNick Coghlan2012-07-181-4/+4
| |
* | Close #15387: inspect.getmodulename() now uses a new ↵Nick Coghlan2012-07-181-1/+12
| | | | | | | | importlib.machinery.all_suffixes() API rather than the deprecated inspect.getmoduleinfo()
* | Closes #15030: Make importlib.abc.PyPycLoader respect the new .pycBrett Cannon2012-07-021-0/+4
| | | | | | | | | | | | | | file size header field. Thanks to Marc Abramowitz and Ronan Lamy for helping out with various parts of the patch.
* | Fix a couple of versionadded/versionchanged related markup errors.Georg Brandl2012-06-241-2/+2
| |
* | Issue #14938: importlib.abc.SourceLoader.is_package() now takes theBrett Cannon2012-06-161-2/+4
| | | | | | | | | | | | | | | | | | module name into consideration when determining whether a module is a package or not. This prevents importing a module's __init__ module directly and having it considered a package, which can lead to duplicate sub-modules. Thanks to Ronan Lamy for reporting the bug.
* | Add importlib.util.resolve_name().Brett Cannon2012-05-131-0/+16
| |
* | Issue #13959: Introduce importlib.find_loader().Brett Cannon2012-05-121-0/+14
| | | | | | | | | | | | The long-term goal is to deprecate imp.find_module() in favour of this API, but it will take some time as some APIs explicitly return/use what imp.find_module() returns.
* | Issue #13959: HaveBrett Cannon2012-05-111-12/+9
| | | | | | | | | | | | | | | | | | | | importlib.abc.FileLoader.load_module()/get_filename() and importlib.machinery.ExtensionFileLoader.load_module() have their single argument be optional as the loader's constructor has all the ncessary information. This allows for the deprecation of imp.load_source()/load_compile()/load_package().
* | Issue #13959: Deprecate imp.get_suffixes() for new attributes onBrett Cannon2012-05-111-0/+37
| | | | | | | | | | | | | | | | | | | | | | importlib.machinery that provide the suffix details for import. The attributes were not put on imp so as to compartmentalize everything importlib needs for setting up imports in importlib.machinery. This also led to an indirect deprecation of inspect.getmoduleinfo() as it directly returned imp.get_suffix's returned tuple which no longer makes sense.
* | Issue #14646: __import__() now sets __loader__ if need be.Brett Cannon2012-04-271-7/+25
| | | | | | | | | | | | importlib.util.module_for_loader also will set __loader__ along with __package__. This is in conjunction to a forthcoming update to PEP 302 which will make these two attributes required for loaders to set.
* | Issue #14605: Rename _SourcelessFileLoader to SourcelessFileLoader.Marc-Andre Lemburg2012-04-251-8/+5
| | | | | | | | | | This time also recreating the Python/importlib.h file to make make happy. See the ticket for details.
* | Issue #14605: Revert renaming of _SourcelessFileLoader, since it causedMarc-Andre Lemburg2012-04-251-5/+8
| | | | | | | | the buildbots to fail.
* | Issue #14605: Rename _SourcelessFileLoader to SourcelessFileLoaderMarc-Andre Lemburg2012-04-241-8/+5
| |
* | Issue #14605: Expose importlib.abc.FileLoader andBrett Cannon2012-04-221-0/+185
| | | | | | | | | | | | | | | | importlib.machinery.(FileFinder, SourceFileLoader, _SourcelessFileLoader, ExtensionFileLoader). This exposes all of importlib's mechanisms that will become public on the sys module.
* | Clarify importlib.machinery.PathFinder's difference from what __import__() does.Brett Cannon2012-03-021-1/+3
| |
* | Minor doc cleanup.Brett Cannon2012-03-021-6/+6
| |
* | Update importlib.invalidate_caches() to be more general.Brett Cannon2012-02-271-3/+12
| |
* | Issue #14043: Speed up importlib's _FileFinder by at least 8x, and add a new ↵Antoine Pitrou2012-02-201-0/+8
| | | | | | | | | | | | importlib.invalidate_caches() function. importlib is now often faster than imp.find_module() at finding modules.
* | Issue #13645: pyc files now contain the size of the corresponding sourceAntoine Pitrou2012-01-131-0/+19
|/ | | | | code, to avoid timestamp collisions (especially on filesystems with a low timestamp resolution) when checking for freshness of the bytecode.
* Fix a few doc errors, mostly undefined keywords.Georg Brandl2011-01-151-12/+12
|
* #9911: doc copyedits.Georg Brandl2010-09-211-1/+1
|
* #6522: add a "decorator" directive to explicitly document decorators, and ↵Georg Brandl2010-07-291-3/+3
| | | | use it in a few places.
* Minor clarification about importlib.abc.SourceLoader.get_filename.Brett Cannon2010-07-211-1/+1
|
* Make importlib.abc.SourceLoader the primary mechanism for importlib.Brett Cannon2010-07-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This required moving the class from importlib/abc.py into importlib/_bootstrap.py and jiggering some code to work better with the class. This included changing how the file finder worked to better meet import semantics. This also led to fixing importlib to handle the empty string from sys.path as import currently does (and making me wish we didn't support that instead just required people to insert '.' instead to represent cwd). It also required making the new set_data abstractmethod create any needed subdirectories implicitly thanks to __pycache__ (it was either this or grow the SourceLoader ABC to gain an 'exists' method and either a mkdir method or have set_data with no data arg mean to create a directory). Lastly, as an optimization the file loaders cache the file path where the finder found something to use for loading (this is thanks to having a sourceless loader separate from the source loader to simplify the code and cut out stat calls). Unfortunately test_runpy assumed a loader would always work for a module, even if you changed from underneath it what it was expected to work with. By simply dropping the previous loader in test_runpy so the proper loader can be returned by the finder fixed the failure. At this point importlib deviates from import on two points: 1. The exception raised when trying to import a file is different (import does an explicit file check to print a special message, importlib just says the path cannot be imported as if it was just some module name). 2. the co_filename on a code object is not being set to where bytecode was actually loaded from instead of where the marshalled code object originally came from (a solution for this has already been agreed upon on python-dev but has not been implemented yet; issue8611).
* Make a sentence a little less awkward.Brett Cannon2010-06-291-2/+1
|
* Move importlib.abc.SourceLoader to _bootstrap.Brett Cannon2010-06-281-1/+2
| | | | | | | | | | | Required updating code relying on other modules to switch to _bootstrap's unique module requirements. This led to the realization that get_code was being too liberal in its exception catching when calling set_data by blindly grabbing IOError. Shifted the responsibility of safely ignoring writes to a read-only path to set_data. Importlib is still not relying on SourceLoader yet; requires creating a SourcelessLoader and updating the source finder.
* Implement importlib.abc.SourceLoader and deprecate PyLoader and PyPycLoader.Brett Cannon2010-06-271-111/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | SourceLoader is a simplification of both PyLoader and PyPycLoader. If one only wants to use source, then they need to only implement get_data and get_filename. To also use bytecode -- sourceless loading is not supported -- then two abstract methods -- path_mtime and set_data -- need to be implemented. Compared to PyLoader and PyPycLoader, there are less abstract methods introduced and bytecode files become an optimization controlled by the ABC and hidden from the user (this need came about as PEP 3147 showed that not treating bytecode as an optimization can cause problems for compatibility). PyLoader is deprecated in favor of SourceLoader. To be compatible from Python 3.1 onwards, a subclass need only use simple methods for source_path and is_package. Otherwise conditional subclassing based on whether Python 3.1 or Python 3.2 is being is the only change. The documentation and docstring for PyLoader explain what is exactly needed. PyPycLoader is deprecated also in favor of SourceLoader. Because PEP 3147 shifted bytecode path details so much, there is no foolproof way to provide backwards-compatibility with SourceLoader. Because of this the class is simply deprecated and users should move to SourceLoader (and optionally PyLoader for Python 3.1). This does lead to a loss of support for sourceless loading unfortunately. At some point before Python 3.2 is released, SourceLoader will be moved over to importlib._bootstrap so that the core code of importlib relies on the new code instead of the old PyPycLoader code. This commit is being done now so that there is no issue in having the API in Python 3.1a1.
* Add a link to PEP 3147 from the importlib docs.Brett Cannon2010-06-271-0/+3
| | | | Closes issue 8667. Thanks Ashley Sands for the patch.