This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients gvanrossum, pitrou
Date 2013-02-09.16:18:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Hm, you seem to be right. Changing the bug title.

So, can we speed up method lookup? It's a shame that I have to start promoting this ugly idiom. There's a similar issue where s[:5]=='abcde' is faster than s.startswith('abcde'):

./python.exe -m timeit -s "a = 'hundred'" "a.startswith('foo')"
1000000 loops, best of 3: 0.281 usec per loop

./python.exe -m timeit -s "a = 'hundred'" "a[:3] == 'foo'"
10000000 loops, best of 3: 0.158 usec per loop
Date User Action Args
2013-02-09 16:18:55gvanrossumsetrecipients: + gvanrossum, pitrou
2013-02-09 16:18:55gvanrossumsetmessageid: <>
2013-02-09 16:18:55gvanrossumlinkissue17170 messages
2013-02-09 16:18:55gvanrossumcreate