On Mon, Jun 2, 2008 at 5:49 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > As a newly converted fan of str.format, it gives me pangs to see the > whole stdlib using "%." I realize that str.format is not quite up to > the speed standards we'd like, but I'm sure that will change. > > In any case, I'm willing to give the TLC to convert the whole stdlib > to str.format, so I just need your permission! <wink>
So glad you asked! There's a standard answer whenever someone suggests a sweeping conversion of the entire stdlib to some new feature. It's "No." :-) In the past, we've tried things like this a few times, and it was nearly always a mistake. Things like this can't be automated 100%, and doing a manual audit of the changes is so incredibly tedious that inevitably a few incorrect changes slip by. In theory these would be caught by unittests, but in practice the difference between practice and theory is larger than in theory, so inevitably the honor falls to some poor schmuck whose application fails in a non-trivial way, often months later. I recall one particularly ill-fated conversion where we some bogus conversions weren't fixed until several years (and releases!) later. And these were pretty badly botched too, something like foo(bar(x, y)) vs. foo(bar(x), y) -- it was just in rarely executed code and due to the complexity of the expressions (and the fact that the parentheses were balanced ;-) nobody had noticed before. It's much better to do this piecemeal, when you are revising a particular module for some other reason. Then you (presumably) have the time to review every change thoroughly -- and hopefully you can even add unittests for all code you touch. I realize that 2to3 might make such conversions less error-prone. But most 2to3 conversions are not 100% correct either, and the problem of falling asleep while reviewing the changes exists especially where there are so many correct conversions! -- --Guido van Rossum (home page: http://www.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