summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-04-17 23:53:21 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-04-17 23:53:21 (GMT)
commit32c59b6fc1140486a9915876054365b40bd88da9 (patch)
tree19d1b96def03bb9975cc4e5166c31fa0d54821ff /Lib/test
parentab2d58eefa222cdc439bef8eb02b3620bc991164 (diff)
downloadcpython-32c59b6fc1140486a9915876054365b40bd88da9.zip
cpython-32c59b6fc1140486a9915876054365b40bd88da9.tar.gz
cpython-32c59b6fc1140486a9915876054365b40bd88da9.tar.bz2
mangle keyword-only argname when loading defaults (closes #14607)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_keywordonlyarg.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_keywordonlyarg.py b/Lib/test/test_keywordonlyarg.py
index 3aebd68..108ed18 100644
--- a/Lib/test/test_keywordonlyarg.py
+++ b/Lib/test/test_keywordonlyarg.py
@@ -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)