I want to add a driver to the Z location of an object via python.
After reading the docs and this question, I would guess something like this:
bpy.context.object.driver_add("location", index=2)
However when run in the python console it says
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
TypeError: driver_add() takes no keyword arguments