Why don't strings share data in Python?
Bengt Richter
bokr at oz.net
Wed Apr 17 01:12:57 EDT 2002
On 16 Apr 2002 23:03:04 -0500, Mike Coleman <mkc+dated+1021607974.93924d at mathdogs.com> wrote:
>Tim Peters <tim.one at comcast.net> writes:
>> There are many reasons, but one of them is invisible to Python users:
>> because Python is intended to play nice with C libraries, all Python strings
>> end with a \0 byte.
>
>Well, that's certainly a bug in the ointment.
>
>I almost thought I might be able to use NumPy arrays, as it looks like they do
>share data. They're not hashable, though, unfortunately, which kills the
>usage I had in mind.
>
So what did you have in mind?
Regards,
Bengt Richter
More information about the Python-list
mailing list