I want to define a new class that inherit the build in str type, and create a method that duplicates the string contents.
How do I get access to the string value assigned to the object of my new class ?
class str_usr(str):
def __new__(cls, arg):
return str.__new__(cls, arg)
def dub(self):
# How to modify the string value in self ?
self.<attr> = self.<attr> + self.<attr>
Thanks for any help :-)