bpo-37108: Support super with methods that use positional-only arguments (GH-13695)

This commit is contained in:
Pablo Galindo 2019-05-31 12:07:56 +01:00 committed by GitHub
parent c7f803b08e
commit 3a46d5c293
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -398,6 +398,20 @@ class PositionalOnlyTestCase(unittest.TestCase):
gen = f()
self.assertEqual(next(gen), (1, 2))
def test_super(self):
sentinel = object()
class A:
def method(self):
return sentinel
class C(A):
def method(self, /):
return super().method()
self.assertEqual(C().method(), sentinel)
if __name__ == "__main__":
unittest.main()