Settin general defaults for named arguments in python
<p>I have the following problem:
I have to set some values for special entities (points, lines, faces, volumes, spheres,...), via an API into a database.</p>

<p>Some values are unique for every entity, others are always the same.
So my idea was to do something like (SetValues is the API command i have to use putting something into the database):</p>

<pre><code>def CreateLineEntity(ID,Name,Solver,P1,P2,Move='no',Perimeter=0.0,Gap='yes'): 
    SetValues(ID, {'Name':Name})
    SetValues(ID, {'P1':P1})
    SetValues(ID, {'P2':P2})
    SetValues(ID, {'Solver':Solver})
    SetValues(ID, {'Move':Move})
    SetValues(ID, {'Perim':Perimeter})
    SetValues(ID, {'Gap':Gap})
######################################################################
def CreatePointEntity(ID,Name,Solver,P1,Move='no',Perimeter=0.0,Gap='yes'): 
    SetValues(ID, {'Name':Name})
    SetValues(ID, {'P1':P1})
    SetValues(ID, {'Solver':Solver})
    SetValues(ID, {'Move':Move})
    SetValues(ID, {'Perim':Perimeter})
    SetValues(ID, {'Gap':Gap})
</code></pre>

<p>So in every function the default for Move is 'no'</p>

<p>If the default changes for some reason i had to check the complete code changing the default now.</p>

<p>Is there a more intelligent way to define such defaults?
My goal is to change only one value in the code and than all defaults in the functions are changed, too</p>