classification
Title: Get rid of trailing comma in the repr() of BaseException
Type: enhancement Stage: patch review
Components: Interpreter Core Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, terry.reedy
Priority: normal Keywords:

Created on 2017-05-18 15:32 by serhiy.storchaka, last changed 2017-05-19 21:28 by terry.reedy.

Pull Requests
URL Status Linked Edit
PR 1650 open serhiy.storchaka, 2017-05-18 15:39
Messages (2)
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.
History
Date User Action Args
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