On 2/13/14 9:45 PM, forman.si...@gmail.com wrote:
For the record I wasn't worried about the performance. ;-)
It was for Tkinter event strings not markup tags.
I'm glad this was the time winner!
"key and key[0] == '<' and key[-1] == '>'"
Cheers to the folks who did the timings (and saved me from the trouble!)
Last but not least... s[::len(s)-1] omg!!? ;-D
If you aren't worried about performance, why are you choosing your code
based on which is the fastest? There are other characteristics
(clarity, flexibility, robustness, ...) that could be more useful.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list