mangle keyword-only argname when loading defaults (closes #14607)

This commit is contained in:
Benjamin Peterson 2012-04-17 19:53:21 -04:00
parent ab2d58eefa
commit 32c59b6fc1
3 changed files with 13 additions and 1 deletions

View file

@ -170,6 +170,12 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
# used to fail with a SystemError.
lambda *, k1=unittest: None
def test_mangling(self):
class X:
def f(self, *, __a=42):
return __a
self.assertEqual(X().f(), 42)
def test_main():
run_unittest(KeywordOnlyArgTestCase)