"dataangel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Paolo Veronelli wrote:
>
>> I want to add some methods to str class ,but when I change the __init__
>> methods I break into problems
Immutable types cannot be changed in __init__. They are initialized in
__new__, which
Paolo Veronelli wrote:
I want to add some methods to str class ,but when I change the
__init__ methods I break into problems
class Uri(str):
def __init__(self,*inputs):
print inputs
if len(inputs)>1:
str.__init__(self,'<%s:%s>'%inputs[:2])
else:
Paolo Veronelli wrote:
I want to add some methods to str class ,but when I change the __init__
methods I break into problems
class Uri(str):
def __init__(self,*inputs):
print inputs
if len(inputs)>1:
str.__init__(self,'<%s:%s>'%inputs[:2])
else:
I want to add some methods to str class ,but when I change the __init__
methods I break into problems
class Uri(str):
def __init__(self,*inputs):
print inputs
if len(inputs)>1:
str.__init__(self,'<%s:%s>'%inputs[:2])