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.

Author terry.reedy
Recipients Jim Fasarakis-Hilliard, levkivskyi, ned.deily, rhettinger, serhiy.storchaka, terry.reedy, xiang.zhang
Date 2017-01-06.21:32:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483738338.61.0.334044025484.issue29116@psf.upfronthosting.co.za>
In-reply-to
Content
By default, error message wording changes are 'enhancements' that wait for the next x.y.0 release unless the current wording is positively wrong'.  This is different from doc changes because there are tests depending on error messages. 'Inconsistent' or 'awkward' is not the same as 'wrong'.

I do agree that the clipped "must be str, not bytes' is awkward.  What (which) is it that must be str?  A fleshed out and positive "can only concatenate str (not bytes) to str." would be clearer and educate users better.

As Serhiy said, the exact equivalent cannot be said for bytes.

>>> b'a' + bytearray(b'b')
b'ab'
>>> b'a' + memoryview(b'b')
b'ab'

However "Can only concatenate bytes, bytearray, or memoryview (not x) to bytes." would be good if this is in fact complete. I need to be educated on this ;-)  I was not sure about memoryview until I tried it.
History
Date User Action Args
2017-01-06 21:32:18terry.reedysetrecipients: + terry.reedy, rhettinger, ned.deily, serhiy.storchaka, levkivskyi, xiang.zhang, Jim Fasarakis-Hilliard
2017-01-06 21:32:18terry.reedysetmessageid: <1483738338.61.0.334044025484.issue29116@psf.upfronthosting.co.za>
2017-01-06 21:32:18terry.reedylinkissue29116 messages
2017-01-06 21:32:18terry.reedycreate