#[python start generated code]*/
def foo(): pass
#/*[python checksum:...]*/
+
+
+.. _clinic-howto-override-signature:
+
+How to override the generated signature
+---------------------------------------
+
+You can use the ``@text_signature`` directive to override the default generated
+signature in the docstring.
+This can be useful for complex signatures that Argument Clinic cannot handle.
+The ``@text_signature`` directive takes one argument:
+the custom signature as a string.
+The provided signature is copied verbatim to the generated docstring.
+
+Example from :source:`Objects/codeobject.c`::
+
+ /*[clinic input]
+ @text_signature "($self, /, **changes)"
+ code.replace
+ *
+ co_argcount: int(c_default="self->co_argcount") = unchanged
+ co_posonlyargcount: int(c_default="self->co_posonlyargcount") = unchanged
+ # etc ...
+
+ Return a copy of the code object with new values for the specified fields.
+ [clinic start generated output]*/
+
+The generated docstring ends up looking like this::
+
+ replace($self, /, **changes)
+ --
+
+ Return a copy of the code object with new values for the specified fields.