summaryrefslogtreecommitdiffstats
path: root/Doc/library/importlib.rst
Commit message (Collapse)AuthorAgeFilesLines
* Issue #18758: Fixed and improved cross-references.Serhiy Storchaka2013-10-131-1/+1
|\
| * [issue19152] Revert 832579dbafd6.Eric Snow2013-10-031-5/+1
| |
| * [issue19152] Add ExtensionFileLoader.get_filename().Eric Snow2013-10-031-1/+5
| |
* | [issue 19152] Add versionadded for ExtensionFileLoader.get_filename().Eric Snow2013-10-051-0/+2
| |
* | [issue19152] Add ExtensionFileLoader.get_filename().Eric Snow2013-10-031-1/+5
| |
* | Issue #18955: clarify what is removed by importlib.util.module_for_loader.Brett Cannon2013-09-131-3/+3
| |
* | merge for issue #18278Brett Cannon2013-06-211-0/+2
|\ \ | |/
| * Issue #18278: properly document how the loaders are called for FileFinderBrett Cannon2013-06-211-0/+2
| |
* | documentation suggesting something which doesn't existBrett Cannon2013-06-161-2/+1
| |
* | Merge doc/argument name fixBrett Cannon2013-06-161-1/+1
|\ \ | |/
| * Fix a misnaming of a method and an argumentBrett Cannon2013-06-161-1/+1
| |
* | Issue #18076: Introduce imoportlib.util.decode_source().Brett Cannon2013-06-161-0/+8
| | | | | | | | | | | | | | The helper function makes it easier to implement imoprtlib.abc.InspectLoader.get_source() by making that function require just the raw bytes for source code and handling all other details.
* | Issue #17907: touch up the code for imp.new_module().Brett Cannon2013-06-151-0/+30
| |
* | Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document theBrett Cannon2013-06-141-0/+7
| | | | | | | | deprecation of imp.get_magic().
* | Issue #18193: Add importlib.reload(), documenting (but notBrett Cannon2013-06-141-0/+67
| | | | | | | | | | | | implementing in code) the deprecation of imp.reload(). Thanks to Berker Peksag for the patch.
* | Issues #18088, 18089: IntroduceBrett Cannon2013-05-311-9/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | importlib.abc.Loader.init_module_attrs() and implement importlib.abc.InspectLoader.load_module(). The importlib.abc.Loader.init_module_attrs() method sets the various attributes on the module being loaded. It is done unconditionally to support reloading. Typically people used importlib.util.module_for_loader, but since that's a decorator there was no way to override it's actions, so init_module_attrs() came into existence to allow for overriding. This is also why module_for_loader is now pending deprecation (having its other use replaced by importlib.util.module_to_load). All of this allowed for importlib.abc.InspectLoader.load_module() to be implemented. At this point you can now implement a loader with nothing more than get_code() (which only requires get_source(); package support requires is_package()). Thanks to init_module_attrs() the implementation of load_module() is basically a context manager containing 2 methods calls, a call to exec(), and a return statement.
* | Add a reset_name argument to importlib.util.module_to_load in order toBrett Cannon2013-05-311-1/+5
| | | | | | | | | | control whether to reset the module's __name__ attribute in case a reload is being done.
* | Add a reference to module_to_loadBrett Cannon2013-05-311-2/+1
| |
* | Rename importlib.util.ModuleManager to module_to_load so that the nameBrett Cannon2013-05-301-6/+7
| | | | | | | | explains better what the context manager is providing.
* | Undo a recommendation as load_module() methods might be called directlyBrett Cannon2013-05-281-5/+1
| |
* | Issue #18070: importlib.util.module_for_loader() now sets __loader__Brett Cannon2013-05-281-8/+14
| | | | | | | | | | and __package__ unconditionally in order to do the right thing for reloading.
* | Clarify some documentationBrett Cannon2013-05-281-31/+17
| |
* | Introduce importlib.util.ModuleManager which is a context manager toBrett Cannon2013-05-281-0/+13
| | | | | | | | | | | | | | | | handle providing (and cleaning up if needed) the module to be loaded. A future commit will use the context manager in Lib/importlib/_bootstrap.py and thus why the code is placed there instead of in Lib/importlib/util.py.
* | Issue #18072: Implement get_code() for importlib.abc.InspectLoader andBrett Cannon2013-05-281-4/+8
| | | | | | | | ExecutionLoader.
* | Move importlib.abc.SourceLoader.source_to_code() to InspectLoader.Brett Cannon2013-05-261-11/+11
| | | | | | | | | | | | | | While the previous location was fine, it makes more sense to have the method higher up in the inheritance chain, especially at a point where get_source() is defined which is the earliest source_to_code() could programmatically be used in the inheritance tree in importlib.abc.
* | mergeBrett Cannon2013-05-251-3/+8
|\ \ | |/
| * Various tweaks to importlib docs.Brett Cannon2013-05-251-3/+8
| |
* | #17115,17116: Have modules initialize the __package__ and __loader__Brett Cannon2013-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 for issue #17357Brett Cannon2013-04-281-5/+5
|\ \ | |/
| * Issue #17357: Use more stern wording forBrett Cannon2013-04-281-5/+5
| | | | | | | | importlib.invalidate_caches().
* | Fix invalid markup.Georg Brandl2013-04-111-2/+2
| |
* | Issue #17093,17566,17567: Methods from classes in importlib.abc now raise/returnBrett Cannon2013-04-091-13/+59
| | | | | | | | | | | | | | | | | | | | the default exception/value when called instead of raising/returning NotimplementedError/NotImplemented (except where appropriate). This should allow for the ABCs to act as the bottom/end of the MRO with expected default results. As part of this work, also make importlib.abc.Loader.module_repr() optional instead of an abstractmethod.
* | Issue #17099: Have importlib.find_loader() raise ValueError whenBrett Cannon2013-03-131-1/+7
| | | | | | | | | | | | __loader__ is not set on a module. This brings the exception in line with when __loader__ is None (which is equivalent to not having the attribute defined).
* | Issue #17117: Have both import itself and importlib.util.set_loader()Brett Cannon2013-03-131-0/+4
| | | | | | | | | | | | set __loader__ on a module when set to None. Thanks to Gökcen Eraslan for the fix.
* | Issue #17215: Fix documentation misprints (patch by July Tikhonov)Andrew Svetlov2013-02-171-1/+1
|\ \ | |/
| * Issue #17215: Fix documentation misprints (patch by July Tikhonov)Andrew Svetlov2013-02-171-1/+1
| |
* | Issue #15627: This is simply an update to the name of a new method recently ↵Eric Snow2012-12-051-1/+1
| | | | | | | | | | | | added to importlib.abc.SourceLoader.
* | Issue #15627: Add the compile_source() method toBrett Cannon2012-11-181-2/+15
| | | | | | | | | | | | | | importlib.abc.SourceLoader. This provides an easy hook into the import system to allow for source transformations, AST optimizations, etc.
* | Merge fix for #16489 from 3.3Brett Cannon2012-11-171-5/+4
|\ \ | |/
| * Issue #16489: Make it clearer that importlib.find_loader() requiresBrett Cannon2012-11-171-5/+4
| | | | | | | | the user to import any parent packages.
* | Issue #15641: Clean up deprecated classes from importlibAndrew Svetlov2012-11-051-138/+0
|/ | | | Patch by Taras Lyapun.
* 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.