classification
Title: collections.UserString missing some str methods
Type: enhancement Stage: needs patch
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Claudiu.Popa, Julian.Gindi, cvrebert, haypo, llllllllll, ncoghlan, python-dev, rhettinger
Priority: low Keywords: easy, patch

Created on 2014-08-13 05:49 by ncoghlan, last changed 2015-05-22 23:57 by rhettinger. This issue is now closed.

Files
File name Uploaded Description Edit
userobjectmethods.patch llllllllll, 2015-04-15 21:28 review
Messages (5)
msg225255 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2014-08-13 05:49
str currently implements some methods that UserString doesn't:

>>> set(dir(str)) - set(dir(UserString))
{'__rmod__', 'casefold', 'isprintable', 'maketrans', 'format_map', '__getnewargs__'}

casefold, isprintable & format_map (and perhaps __rmod__) should likely be available on UserString as well.
msg226041 - (view) Author: Julian Gindi (Julian.Gindi) * Date: 2014-08-28 20:18
Good catch. I'm gonna look into this. Seems like you should be able to access these from UserString as well.
msg241166 - (view) Author: Joe Jevnik (llllllllll) * Date: 2015-04-15 21:28
I have added a patch to add these to UserString. I also wrote a test case that would check the UserString, UserList, and UserDict's methods to make sure that new methods to str, list, or dict (or the removal of one of those methods from the User* version) will cause a test failure.
msg243869 - (view) Author: Roundup Robot (python-dev) Date: 2015-05-22 23:56
New changeset c06b2480766d by Raymond Hettinger in branch 'default':
Issue 22189:  Add missing methods to UserString
https://hg.python.org/cpython/rev/c06b2480766d
msg243870 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2015-05-22 23:57
Thanks Joe.
History
Date User Action Args
2015-05-22 23:57:22rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg243870
2015-05-22 23:56:41python-devsetnosy: + python-dev
messages: + msg243869
2015-04-15 21:28:58llllllllllsetfiles: + userobjectmethods.patch

nosy: + llllllllll
messages: + msg241166

keywords: + patch
2015-03-09 15:21:30serhiy.storchakasetkeywords: + easy
2015-03-09 14:55:30Claudiu.Popasetnosy: + Claudiu.Popa

versions: + Python 3.5
2014-08-29 03:10:37cvrebertsetnosy: + cvrebert
2014-08-28 20:18:30Julian.Gindisetnosy: + Julian.Gindi
messages: + msg226041
2014-08-16 12:20:21hayposetnosy: + haypo
2014-08-13 06:38:14rhettingersetassignee: rhettinger

components: + Library (Lib)
nosy: + rhettinger
2014-08-13 05:49:12ncoghlancreate