➜

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.

作者 dlenski
收信人 dlenski
日期 2017-05-02.19:31:55
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1493753516.03.0.383972145792.issue30238@psf.upfronthosting.co.za>
In-reply-to
内容
Python 2.7 allows indexing an Exception object to access its args list.

>>> e=Exception('foo','bar','baz')
>>> assert e[0] is e.args[0]

This doesn't work in 3.5:

>>> e=Exception('foo','bar','baz')
>>> e.args[0]
'foo'
>>> e[0]
TypeError: 'Exception' object is not subscriptable

This conversion (e[x] -> e.args[x]) seems like it ought to be fairly straightforward to support in 2to3.
历史
日期 用户 动作 参数
2017-05-02 19:31:56dlenski修改recipients: + dlenski
2017-05-02 19:31:56dlenski修改messageid: <1493753516.03.0.383972145792.issue30238@psf.upfronthosting.co.za>
2017-05-02 19:31:56dlenski链接issue30238 messages
2017-05-02 19:31:55dlenski创建