[Python-3000] Exceptions internals and removing sys.exc_*
Tony Lownds
tony at pagedna.com
Sun Jan 21 20:50:42 CET 2007
On Jan 21, 2007, at 10:57 AM, Brett Cannon wrote:
> On 1/21/07, Tony Lownds <tony at pagedna.com> wrote:
>>
>> On Jan 20, 2007, at 9:46 PM, Collin Winter wrote:
>>
>> > Guido has mentioned [1] that since exceptions will be growing a
>> > __traceback__ attribute in Python 3, it should be possible to
>> remove
>> > sys.exc_info().
>>
>> I hope that doesn't happen. sys.exc_info() is the only way to
>> write code
>> using exception values that will run on both 2.5 and 3.0.
>>
>> except Exception:
>> e = sys.exc_info()[1]
>>
>
> As has been stated on python-dev, 3.0 will not be hindered by
> backwards-compatibility. 2.6 is going to be the version that has both
> 2.x and 3.0 features to allow for transitioning.
>
Not allowing 3.0 to be hindered is reasonable, as long as its not a
blind absolute.
ISTM that backwards compatability ought to be weighed, with a strong
bias towards
freedom to change in 3.0. Check out this post:
http://mail.python.org/pipermail/python-dev/2007-January/070665.html
What's the cost of keeping sys.exc_info() on 3.0? If that cost is a
hindrance on 3.0, then
fine, sys.exc_info() and the ability for module authors to use a
single codebase on 2.x and
3.0 can be given up.
If sys.exc_info() is not a hindrance to keep, why would we want to
increase incompatibility?
Maybe I'm misreading that post. I'm not trying to cherry pick posts
or play word games; I just
feel that the loss of the possibility of a single codebase on <=2.5
and 3.0 should not be given
up lightly.
-Tony
More information about the Python-3000
mailing list