gh-117431: Adapt str.startswith and str.endswith to Argument Clinic (#117466)

This change gives a significant speedup, as the METH_FASTCALL calling
convention is now used.
This commit is contained in:
Erlend E. Aasland 2024-04-03 09:11:39 +02:00 committed by GitHub
parent 65524ab388
commit 444156ede4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 149 additions and 49 deletions

View file

@ -1513,9 +1513,9 @@ class StringLikeTest(BaseTest):
x, None, None, None)
self.assertRaisesRegex(TypeError, r'^count\(', s.count,
x, None, None, None)
self.assertRaisesRegex(TypeError, r'^startswith\(', s.startswith,
self.assertRaisesRegex(TypeError, r'^startswith\b', s.startswith,
x, None, None, None)
self.assertRaisesRegex(TypeError, r'^endswith\(', s.endswith,
self.assertRaisesRegex(TypeError, r'^endswith\b', s.endswith,
x, None, None, None)
# issue #15534