## 4 Advanced Topics 

Now that you’ve had some experience working with Argument Clinic, it’s time for some advanced topics. 

## 4.1 Symbolic default values 

The default value you provide for a parameter can’t be any arbitrary expression. Currently the following are explicitly supported: 

• Numeric constants (integer and float) 

• String constants 

• True , False , and None 

• Simple symbolic constants like$_{sys.maxsize}$, which must start with the name of the module 

In case you’re curious, this is implemented in from_builtin() in Lib/inspect.py . 

(In the future, this may need to get even more elaborate, to allow full expressions like$_{CONSTANT - 1}$ .) 

## 4.2 Renaming the C functions and variables generated by Argument Clinic 

Argument Clinic automatically names the functions it generates for you. Occasionally this may cause a problem, if the generated name collides with the name of an existing C function. There’s an easy solution: override the names used for the C functions. Just add the keyword$_{"as"}$ to your function declaration line, followed by the function name you wish to use. Argument Clinic will use that function name for the base (generated) function, then add$_{"_impl"}$ to the end and use that for the name of the impl function. 

For example, if we wanted to rename the C function names generated for$_{pickle.Pickler.dump}$ , it’d look like this: 

/*[clinic input] pickle.Pickler.dump as pickler_dumper ... 

The base function would now be named pickler_dumper() , and the impl function would now be named pickler_dumper_impl() . 

Similarly, you may have a problem where you want to give a parameter a specific Python name, but that name may be inconvenient in C. Argument Clinic allows you to give a parameter different names in Python and in C, using the same$_{"as"}$ syntax: 

/*[clinic input] pickle.Pickler.dump obj: object file as file_obj: object protocol: object = NULL * fix_imports: bool = True 

Here, the name used in Python (in the signature and the$_{keywords}$ array) would be$_{file}$, but the C variable would be named$_{file_obj}$ . 

You can use this to rename the$_{self}$parameter too! 

