[Python-checkins] r57271 - sandbox/trunk/import_in_py/NOTES

brett.cannon python-checkins at python.org
Wed Aug 22 01:17:23 CEST 2007


Author: brett.cannon
Date: Wed Aug 22 01:17:22 2007
New Revision: 57271

Removed:
   sandbox/trunk/import_in_py/NOTES
Log:
Notes are no longer needed.


Deleted: /sandbox/trunk/import_in_py/NOTES
==============================================================================
--- /sandbox/trunk/import_in_py/NOTES	Wed Aug 22 01:17:22 2007
+++ (empty file)
@@ -1,46 +0,0 @@
-py/pyc loader API (beyond load_module):
-* mod_time(module_name) -> int
-    Find out the modification time for a source module.  If no source module
-    exists, raise XXX.
-* get_source(module_name) -> str
-    Return the text for a source module.  Defined as part of PEP 302's optional
-    extensions.
-* get_bytecode(module_name) -> bytes
-    Return the bytes for a bytecode-stored module (including timestamp and
-    cookie).
-* write_bytecode(module_name, data:bytes) -> bool
-    Write out the new representation of a bytecode module.  Returns a boolean
-    representing whether the bytes were actually written out or not.
-
-
-Handler API:
-* cannot_handle(name:str) -> bool
-    Can the handler handle the specified module?
-    XXX Perhaps this should just be something that is not part of the official
-    API and is just handled by importers and loaders that need to do
-    whitelisting?
-* handle_code(loader:object, mod_name:str, file_path:str, 
-                source:bool, bytecode:bool,
-                package_path:str|None=None) -> object
-    Handle the loading of the specified module.  All needed objects to be set
-    as attributes on the module are passed in as arguments (__file__,
-    __loader__, and __path__).  Also any other information that must be known
-    for any proper import to occur is specified up front.  All other
-    information that is optional and varies depending on what the loader can
-    provide is done through a separate API provided by the loader.
-
-
-Optional PEP 302 extensions:
-* get_data(path:str) -> bytes
-* is_package(fullname:str) -> bool
-* get_code(fullname:str) -> code
-    XXX Really unfortunate as it pushes unneeded code issues into the
-    importer/loader.  For simplicity, naively compile source and fall back on
-    bytecode only if no source (require a check for the bytecode cookie?).
-    Might be prudent to end up with a function in imp that takes a loader and
-    can handle the proper thing to do based on source() and bytecode().  As PEP
-    302 does not specify that get_code necessarily deals with this issue, can
-    probably cheat and just use bytecode blindly if no source is available, but
-    test first (generate a zip of .pyc files from 2.4, open with zipimport in
-    2.5 and see what get_code() does).
-* get_source(fullname:str) -> str


More information about the Python-checkins mailing list