<div dir="ltr">Thanks a lot,<div><br></div><div><div>So, apparently it is possible to use a re bytes pattern to search through array.array('u') and it works as well for numpy.chararray.<br></div></div><div><br></div><div>However, I suppose that for doing this you need to have knowledge of the internal encoding, because re.search will actually compare bytes (from the pattern) to unicode chars (from the array). So, the bytes have to be utf32-encoded strings, I suppose.</div><div><br></div><div>Currently I have not enough knowledge of how Python strings are implemented. I'm convinced that it's a good thing to have mutable strings, but I guess it could indeed be hard to implement.</div><div><br></div><div>Cheers,</div><div>Jonathan</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-08 22:46 GMT+02:00 Chris Barker <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Fri, May 8, 2015 at 5:50 AM, Stefan Behnel <span dir="ltr"><<a href="mailto:stefan_ml@behnel.de" target="_blank">stefan_ml@behnel.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ISTM that your best bet is currently to look for a suitable module on PyPI<br>
that implements mutable character arrays. I'm sure you're not the only one<br>
who needs something like that. The usual suspect would be NumPy, but there<br>
may be smaller and simpler tools available.</blockquote><div><br></div></span><div>Numpy does have mutable character arrays -- and the Unicode version uses 4bytes per char, regardless of platform (and so should array.array!)</div><div><br></div><div>But I don't think you get much of any of the features of strings, and I doubt that the re module would work with it.</div><div><br></div><div>A "real" mutable string type might be pretty nice to have , but I think it would be pretty hard to d to get it to do everything a string can do. (or maybe not -- I suppose you could cut and paste the regular string cdce, and simply add the mutable part....)</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Chris</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div></font></span></div><span class="HOEnZb"><font color="#888888">-- <br><div><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            <a href="tel:%28206%29%20526-6959" value="+12065266959" target="_blank">(206) 526-6959</a>   voice<br>7600 Sand Point Way NE   <a href="tel:%28206%29%20526-6329" value="+12065266329" target="_blank">(206) 526-6329</a>   fax<br>Seattle, WA  98115       <a href="tel:%28206%29%20526-6317" value="+12065266317" target="_blank">(206) 526-6317</a>   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</font></span></div></div>
<br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/codeofconduct/</a><br></blockquote></div><br></div>