mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
mangle keyword-only argname when loading defaults (closes #14607)
This commit is contained in:
parent
ab2d58eefa
commit
32c59b6fc1
3 changed files with 13 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue