Re: Subclassing str object

2011-08-31 Thread Ian Kelly
2011/8/31 Yaşar Arabacı : > @Ian: Thanks for you comments. I indeed didn't need the _sozcuk attribute at > all, so I deleted it. My class's addition and multiplication works without > overwriting __add__ and __mul__ because, this class uses unicode's __add__ > and __mul__ than creates a new kelime

Re: Subclassing str object

2011-08-31 Thread Yaşar Arabacı
@Ian: Thanks for you comments. I indeed didn't need the _sozcuk attribute at all, so I deleted it. My class's addition and multiplication works without overwriting __add__ and __mul__ because, this class uses unicode's __add__ and __mul__ than creates a new kelime instance with return value of thos

Re: Subclassing str object

2011-08-31 Thread Ian Kelly
2011/8/31 Yaşar Arabacı : > I made a class like this (I shortened it just to show the point), what do > you think about it, do you think it is the python way of subclassing str (or > unicode in this case) You don't need the _sozcuk attribute at all here. It's just the same as the value of the uni

Re: Subclassing str object

2011-08-31 Thread Terry Reedy
On 8/31/2011 7:43 AM, Yaşar Arabacı wrote: Hİ, I originally posted my question to here: http://stackoverflow.com/q/7255655/886669 Could you people please look at it and enlighten me a little bit? I would appreciate an answer either from here or at stackoverflow. I believe two people already ga

Re: Subclassing str object

2011-08-31 Thread Yaşar Arabacı
I made a class like this (I shortened it just to show the point), what do you think about it, do you think it is the python way of subclassing str (or unicode in this case) # -*- coding:utf-8 -*-class kelime(unicode): def __init__(self,sozcuk): self._sozcuk = sozcuk def __getattr

Subclassing str object

2011-08-31 Thread Yaşar Arabacı
Hİ, I originally posted my question to here: http://stackoverflow.com/q/7255655/886669 Could you people please look at it and enlighten me a little bit? I would appreciate an answer either from here or at stackoverflow. Thanks in advance. -- http://yasar.serveblog.net/ -- http://mail.python.org