On 5 feb, 11:48, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I want to have a str with custom methods, but I have this problem:
>
> class myStr(str):
> def hello(self):
> return 'hello '+self
>
> s=myStr('world')
> print s.hello() # prints 'hello world'
> s=s.upper()
> print s.hell
On 5 Feb 2007 02:48:08 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I want to have a str with custom methods, but I have this problem:
>
> class myStr(str):
> def hello(self):
> return 'hello '+self
>
> s=myStr('world')
> print s.hello() # prints 'hello world'
> s=s.upper()
> p
On Feb 5, 5:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I want to have a str with custom methods, but I have this problem:
>
> class myStr(str):
> def hello(self):
> return 'hello '+self
>
> s=myStr('world')
> print s.hello() # prints 'hello world'
> s=s.upper()
> print s.he
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] wrote:
>
>> I want to have a str with custom methods, but I have this problem:
>>
>> class myStr(str):
>> def hello(self):
>> return 'hello '+self
>>
>> s=myStr('world')
>> print s.hello() # prints 'hello
In <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> I want to have a str with custom methods, but I have this problem:
>
> class myStr(str):
> def hello(self):
> return 'hello '+self
>
> s=myStr('world')
> print s.hello() # prints 'hello world'
> s=s.upper()
> print s.hello() # expect
I want to have a str with custom methods, but I have this problem:
class myStr(str):
def hello(self):
return 'hello '+self
s=myStr('world')
print s.hello() # prints 'hello world'
s=s.upper()
print s.hello() # expected to print 'hello WORLD', but s is no longer
myStr, it's a regular st