"""
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
PyObject *return_value = NULL;
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
+ #define NUM_KEYWORDS 1
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
PyObject *return_value = NULL;
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 3
+ #define NUM_KEYWORDS 2
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
PyObject *return_value = NULL;
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
+ #define NUM_KEYWORDS 1
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
#ifndef DESERIALIZE_METHODDEF
#define DESERIALIZE_METHODDEF
#endif /* !defined(DESERIALIZE_METHODDEF) */
-/*[clinic end generated code: output=3c6d0b748fac016f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7d41a178b7b2b683 input=a9049054013a1b77]*/
PyObject *return_value = NULL;
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- #define NUM_KEYWORDS 2
+ #define NUM_KEYWORDS 1
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
exit:
return return_value;
}
-/*[clinic end generated code: output=71b2a15aa86c2bcf input=a9049054013a1b77]*/
+/*[clinic end generated code: output=aa352c3a67300056 input=a9049054013a1b77]*/
fail("A 'defining_class' parameter cannot have a default value.")
if self.group:
fail("A 'defining_class' parameter cannot be in an optional group.")
+ kind = inspect.Parameter.POSITIONAL_ONLY
else:
fail("A 'defining_class' parameter, if specified, must either "
"be the first thing in the parameter block, or come just "