Hi! > On Wed, 29 Mar 2000, Peter Funk wrote: > > > class UserString: > > def __init__(self, string=""): > > self.data = string > ^^^^^^^ Moshe Zadka wrote: > Why do you feel there is a need to default? Strings are immutable I had something like this in my mind: class MutableString(UserString): """Python strings are immutable objects. But of course this can be changed in a derived class implementing the missing methods. >>> s = MutableString() >>> s[0:5] = "HUH?" """ def __setitem__(self, char): .... def __setslice__(self, i, j, substring): .... > What about __int__, __long__, __float__, __str__, __hash__? > And what about __getitem__ and __contains__? > And __complex__? I was obviously too tired and too eager to get this out! Thanks for reviewing and responding so quickly. I will add them. Regards, Peter -- Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260 office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4