Brett Cannon added the comment: So the descriptor idea didn't work.
Another idea is to have the C code that relies on attributes on warnings that are allowed to change have an initial check for warnings, and if that fails to fall back on C code. That way the module can still be completely self-sufficient while still allowing users to change values from Python code. For instance, take warnings.filters. Initially it can be set to _warnings.filters. But in the C code, where access to the filters list is needed, a check is first done to see if the warnings module has been imported. If so, check for a filters attribute. If it exists, replace the internal list with that one and continue on. If the module is not there, however, use the list stored statically in the module without change. Same idea of the once registry and a similar idea for showwarnings(). _____________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1631171> _____________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com