Brett Cannon added the comment:

All of the exception code is written in C. My hypothesis is that it isn't 
necessary to define *all* exceptions in C. Using a technique similar to 
importlib, I suspect we could write a bunch of the exceptions that are not 
critical to interpreter startup in Python for easier maintenance and usage by 
other interpreters. You would need to make sure the Python objects did get set 
on the proper C global variables for access by C extension code. You could use 
BaseException or something temporarily for all exceptions before loading the 
Python code and then replace the temporary placeholders with the actual 
exceptions.

IOW, you would need to:

1. Identify which exceptions are necessary to load the Python code holding some 
built-in exceptions
2. Write Python code for the exceptions which are not necessary for interpreter 
startup
3. Load the Python file during startup ala importlib
4. Make sure the exceptions make it into the builtin namespace
5. Make sure the exceptions end up in the proper C global variables

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21243>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to