[Python-checkins] r56967 - sandbox/trunk/import_in_py/NOTES
brett.cannon
python-checkins at python.org
Mon Aug 13 00:15:35 CEST 2007
Author: brett.cannon
Date: Mon Aug 13 00:15:34 2007
New Revision: 56967
Modified:
sandbox/trunk/import_in_py/NOTES
Log:
Point out how get_code() is a misplaced method by pushing code handling
requirements on to the loader when it should be done elsewhere. Propose some
ways to deal with it.
Modified: sandbox/trunk/import_in_py/NOTES
==============================================================================
--- sandbox/trunk/import_in_py/NOTES (original)
+++ sandbox/trunk/import_in_py/NOTES Mon Aug 13 00:15:34 2007
@@ -4,8 +4,7 @@
exists, raise XXX.
* source(module_name) -> str
Return the text for a source module.
- XXX Can this be replaced by get_source? Only if expected to be defined on
- a loader.
+ XXX Consider just using get_source from PEP 302 optional extensions.
* bytecode(module_name) -> bytes
Return the bytes for a bytecode module.
XXX Rename to get_bytecode if get_source is viable for source().
@@ -35,6 +34,11 @@
* 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().
* get_source(fullname:str) -> str
More information about the Python-checkins
mailing list