Re: [Tutor] subclassing strings

2008-01-08 Thread Eric Abrahamsen
Thanks both of you, that cleared a lot of things up. On Jan 9, 2008, at 11:49 AM, Kent Johnson wrote: > > No, you can't access the actual byte array from Python and you can't > damage it. I don't know a lick of C and probably never will, but I do like to know what it is, exactly, that I don't

Re: [Tutor] subclassing strings

2008-01-08 Thread Kent Johnson
Tiger12506 wrote: > PS. Anyone who's interested. A significant study of C has brought me to > these conclusions. > immutable -> implemented with static buffer > mutable -> implemented with linked list > Anyone know a little more detail? Certainly not true of Python. I don't know of any standard Py

Re: [Tutor] subclassing strings

2008-01-08 Thread Kent Johnson
Eric Abrahamsen wrote: > When I create a string like so: > > x = 'myvalue' > > my understanding is that this is equivalent to: > > x = str('myvalue') > > and that this second form is more fundamental: the first is a > shorthand for the second. The second does nothing that the first doesn't

Re: [Tutor] subclassing strings

2008-01-08 Thread Tiger12506
Ahh. Excellent questions. > I'm playing around with subclassing the built-in string type, and > realizing there's quite a bit I don't know about what's going on with > the built-in types. When I create a string like so: > > x = 'myvalue' > > my understanding is that this is equivalent to: > > x =

[Tutor] subclassing strings

2008-01-08 Thread Eric Abrahamsen
I'm playing around with subclassing the built-in string type, and realizing there's quite a bit I don't know about what's going on with the built-in types. When I create a string like so: x = 'myvalue' my understanding is that this is equivalent to: x = str('myvalue') and that this second f