[Python-checkins] peps: Updates based on implementation progress
nick.coghlan
python-checkins at python.org
Sat Jan 12 15:48:40 CET 2013
http://hg.python.org/peps/rev/89781bc231d9
changeset: 4665:89781bc231d9
user: Nick Coghlan <ncoghlan at gmail.com>
date: Sun Jan 13 00:48:28 2013 +1000
summary:
Updates based on implementation progress
files:
pep-0432.txt | 28 ++++++++++++++++++++++++----
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/pep-0432.txt b/pep-0432.txt
--- a/pep-0432.txt
+++ b/pep-0432.txt
@@ -177,6 +177,8 @@
* Whether or not to use randomised hashes (and if used, potentially specify
a specific random seed)
+* Whether or not to enable the import system (required by CPython's
+ build process when freezing the importlib._bootstrap bytecode)
* The "Where is Python located?" elements in the ``sys`` module:
* ``sys.executable``
* ``sys.base_exec_prefix``
@@ -406,6 +408,7 @@
TBD: Cover the initialization of the following in more detail:
+* Completely disabling the import system
* The initial warning system state:
* ``sys.warnoptions``
* (-W option, PYTHONWARNINGS)
@@ -612,9 +615,10 @@
int ignore_environment; /* -E switch */
int use_hash_seed; /* PYTHONHASHSEED */
unsigned long hash_seed; /* PYTHONHASHSEED */
+ int _disable_importlib; /* Needed by freeze_importlib */
} Py_CoreConfig;
- #define Py_CoreConfig_INIT {0, -1, 0}
+ #define Py_CoreConfig_INIT {0, -1, 0, 0}
The core configuration settings pointer may be ``NULL``, in which case the
default values are ``ignore_environment = 0`` and ``use_hash_seed = -1``.
@@ -661,6 +665,13 @@
``hash_seed``. On success the function will return zero. A non-zero return
value indicates an error (most likely in the conversion to an integer).
+The ``_disable_importlib`` setting is used as part of the CPython build
+process to create an interpreter with no import capability at all. It is
+considered private to the CPython development team (hence the leading
+underscore), as the only known use case is to permit compiler changes
+that invalidate the previously frozen bytecode for ``importlib._bootstrap``
+without breaking the build process.
+
The aim is to keep this initial level of configuration as small as possible
in order to keep the bootstrapping environment consistent across
different embedding applications. If we can create a valid interpreter state
@@ -1046,8 +1057,17 @@
Implementation
==============
-None as yet. Once I have a reasonably solid plan of attack, I intend to work
-on a reference implementation as a feature branch in my BitBucket sandbox [2_]
+The reference implementation is being developed as a feature branch in my
+BitBucket sandbox [2_].
+
+As the number of application binaries created by the build process is now
+four, the reference implementation also creates a new top level "Apps"
+directory in the CPython source tree. The source files for the main
+``python`` binary and the new ``pysystem`` binary will be located in that
+directory. The source files for the ``_freeze_importlib`` binary and the
+``_testembed`` binary have been moved out of the Modules directory (which
+is intended for CPython builtin and extension modules) and into the Tools
+directory.
References
@@ -1057,7 +1077,7 @@
(http://wiki.python.org/moin/CPythonInterpreterInitialization)
.. [2] BitBucket Sandbox
- (https://bitbucket.org/ncoghlan/cpython_sandbox)
+ (https://bitbucket.org/ncoghlan/cpython_sandbox/compare/pep432_modular_bootstrap..default#commits)
.. [3] \*nix getpath implementation
(http://hg.python.org/cpython/file/default/Modules/getpath.c)
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list