This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients brett.cannon, nnorwitz
Date 2007-10-14.04:55:58
SpamBayes Score 0.014506956
Marked as misclassified No
Message-id <1192337759.08.0.333891845477.issue1631171@psf.upfronthosting.co.za>
In-reply-to
Content
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().
History
Date User Action Args
2007-10-14 04:55:59brett.cannonsetspambayes_score: 0.014507 -> 0.014506956
recipients: + brett.cannon, nnorwitz
2007-10-14 04:55:59brett.cannonsetspambayes_score: 0.014507 -> 0.014507
messageid: <1192337759.08.0.333891845477.issue1631171@psf.upfronthosting.co.za>
2007-10-14 04:55:59brett.cannonlinkissue1631171 messages
2007-10-14 04:55:58brett.cannoncreate