> From: Steven D'Aprano
> To: tutor@python.org
> Cc:
> Sent: Friday, May 10, 2013 1:28 PM
> Subject: Re: [Tutor] MutableString/Class variables
>
> On 09/05/13 22:10, Albert-Jan Roskam wrote:
>> Hello,
>>
>> I was just playing a bit with
On 09/05/13 22:10, Albert-Jan Roskam wrote:
Hello,
I was just playing a bit with Python and I wanted to make a mutable string,
that supports item assignment. Is the way below the way to do this?
Guido's time machine strikes again:
py> from UserString import MutableString
py> s = MutableStri
>Subject: Re: [Tutor] MutableString/Class variables
>On 05/09/2013 09:16 AM, Albert-Jan Roskam wrote:
>>> On 05/09/2013 08:10 AM, Albert-Jan Roskam wrote:
>>>> Hello,
>>>>
>>>> I was just playing a bit with Python and I wanted to make a mut
On 05/09/2013 09:16 AM, Albert-Jan Roskam wrote:
Subject: Re: [Tutor] MutableString/Class variables
On 05/09/2013 08:10 AM, Albert-Jan Roskam wrote:
Hello,
I was just playing a bit with Python and I wanted to make a mutable string,
that supports item assignment. Is the way below the
On 9 May 2013 14:16, Albert-Jan Roskam wrote:
>
>
>> Subject: Re: [Tutor] MutableString/Class variables
>>
>> On 05/09/2013 08:10 AM, Albert-Jan Roskam wrote:
>>> Hello,
>>>
>>> I was just playing a bit with Python and I wanted to make a mutab
> Subject: Re: [Tutor] MutableString/Class variables
>
> On 05/09/2013 08:10 AM, Albert-Jan Roskam wrote:
>> Hello,
>>
>> I was just playing a bit with Python and I wanted to make a mutable string,
> that supports item assignment. Is the way below the way to
On 05/09/2013 08:10 AM, Albert-Jan Roskam wrote:
Hello,
I was just playing a bit with Python and I wanted to make a mutable string,
that supports item assignment. Is the way below the way to do this?
The part I am not sure about is the class variable. Maybe I should also have
reimplemented __i
On 09/05/13 13:10, Albert-Jan Roskam wrote:
class MutableStr(str):
s = None
Why make s a class variable?
I'd expect it to be an instance attribute.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
___
Tutor maillist
Hello,
I was just playing a bit with Python and I wanted to make a mutable string,
that supports item assignment. Is the way below the way to do this?
The part I am not sure about is the class variable. Maybe I should also have
reimplemented __init__, then call super inside this and add an upda