bpo-34838: Use subclass_of for math.dist. (GH-9659)

Argument clinic now generates fast inline code for
positional parsing, so the manually implemented type
check in math.dist can be removed.
This commit is contained in:
Ammar Askar 2019-01-12 01:23:41 -05:00 committed by Serhiy Storchaka
parent fdf282d609
commit cb08a71c5c
3 changed files with 14 additions and 9 deletions

View file

@ -867,6 +867,8 @@ class MathTests(unittest.TestCase):
dist((1, 2, 3, 4), (5, 6, 7))
with self.assertRaises(ValueError): # Check dimension agree
dist((1, 2, 3), (4, 5, 6, 7))
with self.assertRaises(TypeError): # Rejects invalid types
dist("abc", "xyz")
# Verify that the one dimensional case is equivalent to abs()
for i in range(20):