Issue 22189: collections.UserString missing some str methods (original) (raw)

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Claudiu.Popa, Julian.Gindi, cvrebert, llllllllll, ncoghlan, orivej, python-dev, rhettinger, serhiy.storchaka, vstinner
Priority: Keywords: easy, patch

Created on 2014-08-13 05:49 by ncoghlan, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
userobjectmethods.patch llllllllll,2015-04-15 21:28 review
Messages (8)
msg225255 - (view) Author: Alyssa 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) (Python triager) 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.
msg338850 - (view) Author: Orivej Desh (orivej) * Date: 2019-03-26 04:09
collections.UserString.__rmod__ references an undefined variable `args`: def __rmod__(self, format): return self.__class__(format % args) https://github.com/python/cpython/commit/573b44c18f69307d7dbc95c950aab57ef7ea303e#diff-8a750c700ae5ac1d0a14922de83e99ccR1109
msg338852 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-03-26 04:24
Orivej Desh, would you care to make PR to fix this (and add a test)?
msg338855 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-03-26 06:12
> collections.UserString.__rmod__ references an undefined variable `args`: This is a duplicate of .
History
Date User Action Args
2022-04-11 14:58:06 admin set github: 66385
2019-03-26 06:12:12 serhiy.storchaka set status: open -> closednosy: + serhiy.storchakamessages: + resolution: fixedstage: needs patch -> resolved
2019-03-26 04:24:27 rhettinger set priority: low -> status: closed -> openresolution: fixed -> (no value)messages: +
2019-03-26 04:09:45 orivej set nosy: + orivejmessages: +
2015-05-22 23:57:22 rhettinger set status: open -> closedresolution: fixedmessages: +
2015-05-22 23:56:41 python-dev set nosy: + python-devmessages: +
2015-04-15 21:28:58 llllllllll set files: + userobjectmethods.patchnosy: + llllllllllmessages: + keywords: + patch
2015-03-09 15:21:30 serhiy.storchaka set keywords: + easy
2015-03-09 14:55:30 Claudiu.Popa set nosy: + Claudiu.Popaversions: + Python 3.5
2014-08-29 03:10:37 cvrebert set nosy: + cvrebert
2014-08-28 20🔞30 Julian.Gindi set nosy: + Julian.Gindimessages: +
2014-08-16 12:20:21 vstinner set nosy: + vstinner
2014-08-13 06:38:14 rhettinger set assignee: rhettingercomponents: + Library (Lib)nosy: + rhettinger
2014-08-13 05:49:12 ncoghlan create