-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
collections.UserString missing some str methods #66385
Comments
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. |
Good catch. I'm gonna look into this. Seems like you should be able to access these from UserString as well. |
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. |
New changeset c06b2480766d by Raymond Hettinger in branch 'default': |
Thanks Joe. |
collections.UserString.rmod references an undefined variable def __rmod__(self, format):
return self.__class__(format % args) |
Orivej Desh, would you care to make PR to fix this (and add a test)? |
This is a duplicate of bpo-25652. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: