[Python-checkins] r56884 - sandbox/trunk/import_in_py/NOTES
brett.cannon
python-checkins at python.org
Fri Aug 10 04:57:19 CEST 2007
Author: brett.cannon
Date: Fri Aug 10 04:57:17 2007
New Revision: 56884
Modified:
sandbox/trunk/import_in_py/NOTES
Log:
Update notes with what the optional API from PEP 302 is and whether
cannot_handle() is reasonable to require on handlers.
Modified: sandbox/trunk/import_in_py/NOTES
==============================================================================
--- sandbox/trunk/import_in_py/NOTES (original)
+++ sandbox/trunk/import_in_py/NOTES Fri Aug 10 04:57:17 2007
@@ -17,6 +17,9 @@
Handler API:
* cannot_handle(name:str) -> bool
Can the handler handle with 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
@@ -26,3 +29,10 @@
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
+* get_source(fullname:str) -> str
More information about the Python-checkins
mailing list