On Fri, Jan 8, 2010 at 6:27 AM, Antoine Pitrou <solip...@pitrou.net> wrote: > Le Thu, 07 Jan 2010 22:11:36 +0100, Martin v. Löwis a écrit : >> >> Even if we do use the new API, and correctly, it still might be >> confusing if the contents of the buffer changes underneath. > > Well, no more confusing than when you compute a SHA1 hash or zlib- > compress the buffer, is it?
That depends. Algorithms that make exactly one pass over the buffer will run fine (maybe producing a meaningless result). But the regex matcher may scan the buffer repeatedly (for backtracking purposes) and it would take a considerable analysis to prove that cannot mess up its internal data structures if the data underneath changes. (I give it a decent chance that it's fine, but since it was written without ever considering this possibility I'm not 100% sure.) -- --Guido van Rossum (python.org/~guido) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com