Jack Diederich writes: > I make a go at doing an idiomatic convertion [...] patch attached. > > WOW, I love partition. In all the instances that weren't a simple "in" > test I ended up using [r]partition. In some cases one of the returned > strings gets thrown away but in those cases it is guaranteed to be small. > The new code is usually smaller than the old and generally clearer.
Wow. That's just beautiful. This has now convinced me that dumping [r]find() (at least!) and pushing people toward using partition will result in pain in the short term (of course), and beautiful, readable code in the long term. > If folks like the way this partial set looks I'll convert the rest. Please do! Even if we *retain* [r]find(), this is still better code. And I'm personally going to stop using [r]find() in my own code starting today. -- Michael Chermside _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
