Fastest way to calculate leading whitespace

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sun May 9 01:13:11 EDT 2010


On Sat, 08 May 2010 13:46:59 -0700, Mark Dickinson wrote:

>> However, s[:-len(t)] should be both faster and correct.
> 
> Unless len(t) == 0, surely?

Doh! The hazards of insufficient testing. Thanks for catching that.



-- 
Steven



More information about the Python-list mailing list