
As an aside, is it planned that sys.exc_traceback,type and value will start emitting DeprecationWarnings any time soon? [...]
It's hard to put a deprecation warning on these, because they're just module attributes.
This came up a day or two ago in c.l.py too. Bernhard Herzog suggested:
What you could do, I think, is turn sys into an instance of a subclass of module and make exc_traceback and friends properties in that new subclass whose get functions simply return the appropriate value from sys.exc_info(). That would actually solve the bug wrt. threading and the get function could also issue a warning. [1]
Seems feasible; but also seems to incur a cost for every attribute lookup in sys, and might be a bad precedent for fancy attribute access for modules.
[1] <http://groups.google.com/groups?selm=6qn0gp23kr.fsf%40salmakis.intevation.de>
Well, this *is* the recommended trick when you absolutely, really need to trap module attribute access. I don't expect access to sys attributes to be time-critical, with a possible exception for sys.stdout (which is used internally by the print statement). But I think attribute access, even with a warnings check, can be fast enough. The big problem is that it would require a major rewrite of the sys module, wouldn't it? --Guido van Rossum (home page: http://www.python.org/~guido/)