mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-117613: Argument Clinic: ensure that 'defining_class' params are positional-only (#117781)
This commit is contained in:
parent
1316692e8c
commit
c520bf9bdf
4 changed files with 17 additions and 6 deletions
|
@ -2508,6 +2508,16 @@ class ClinicParserTest(TestCase):
|
|||
"""
|
||||
self.expect_failure(block, err, lineno=7)
|
||||
|
||||
def test_kind_defining_class(self):
|
||||
function = self.parse_function("""
|
||||
module m
|
||||
class m.C "PyObject *" ""
|
||||
m.C.meth
|
||||
cls: defining_class
|
||||
""", signatures_in_block=3, function_index=2)
|
||||
p = function.parameters['cls']
|
||||
self.assertEqual(p.kind, inspect.Parameter.POSITIONAL_ONLY)
|
||||
|
||||
|
||||
class ClinicExternalTest(TestCase):
|
||||
maxDiff = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue