Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue30399

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Get rid of trailing comma in the repr() of BaseException
Type:enhancementStage:resolved
Components:Interpreter CoreVersions:Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: serhiy.storchaka, terry.reedy
Priority:normalKeywords:

Created on2017-05-18 15:32 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 1650mergedserhiy.storchaka,2017-05-18 15:39
Messages (3)
msg293928 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2017-05-18 15:32
The repr() of BaseException (and all exceptions that don't override __repr__) with a single argument contains a redundant trailing comma:>>> BaseException('spam')BaseException('spam',)This is just an artefact of the implementation.Proposed patch removes this comma.
msg293977 -(view)Author: Terry J. Reedy (terry.reedy)*(Python committer)Date: 2017-05-19 21:28
I think the trailing comma is slightly worse than redundant, as someone who has forgotten the trailing comma rule for calls can mistakenly read it as making the arg a tuple.  So +1 on removing it.
msg306278 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2017-11-15 15:53
New changesetf8a4c03ede6048022f60a58d5a21b278b78a8a16 by Serhiy Storchaka in branch 'master':bpo-30399: Get rid of trailing comma in the repr of BaseException. (#1650)https://github.com/python/cpython/commit/f8a4c03ede6048022f60a58d5a21b278b78a8a16
History
DateUserActionArgs
2022-04-11 14:58:46adminsetgithub: 74584
2017-11-15 15:54:13serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-11-15 15:53:32serhiy.storchakasetmessages: +msg306278
2017-05-19 21:28:28terry.reedysetnosy: +terry.reedy
messages: +msg293977
2017-05-19 18:22:10serhiy.storchakasettitle: Get rid of trailing comma if the repr() of BaseException -> Get rid of trailing comma in the repr() of BaseException
2017-05-18 15:39:31serhiy.storchakasetpull_requests: +pull_request1745
2017-05-18 15:32:17serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp