Guido van Rossum wrote: > for c in ph.loggerMap.keys(): > if string.find(c.parent.name, alogger.name) <> 0: > alogger.parent = c.parent > c.parent = alogger > > This is either a really weird way of writing "if not > c.parent.name.startswith(alogger.name):"
weird, indeed, but it could be a premature attempt to optimize away the slicing for platforms that don't have "startswith" (it doesn't look like a bug, afaict). (on the other hand, "s[:len(t)] == t" is usually faster than "s.startswith(t)" for short prefixes, so maybe someone should have done a bit more benchmarking...) (which reminds me that speeding up handling of optional arguments to C functions would be an even better use of this energy) </F> _______________________________________________ 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
