![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: best way to determine sequence ordering?
From: Edward Elliott <nobody@127.0.0.1>
Date: Sun Apr 30 2006 - 02:07:12 CEST
Steven Bethard wrote:
First of all, your functions aren't quite comparable. The first index takes
Secondly, the lists you tested with are artificially short. As you increase
$ python -m timeit -s "import temp; L = ['x'] * 500 + ['C', 'A', 'D', 'B']"
$ python -m timeit -s "import temp; L = ['x'] * 500 + ['C', 'A', 'D', 'B']"
Third, the target values are very close together in those lists. If there's
$ python -m timeit -s "import temp; L = ['C','A'] + ['x'] * 500 + ['D',
$ python -m timeit -s "import temp; L = ['C','A'] + ['x'] * 500 + ['D',
Remember kids:
|