title: Conditionally passing a named keyword argument to a function
body: <p>I'm not sure if I'm using the correct wording in my question but the situation I have is that I'm calling a function and passing a value to one of its named keyword arguments only if I have a value for it. A simplified example of how I'm currently doing it: </p>
  
  <pre><code>var_1 = data.get("var_1", None)
  
  if var_1:
      some_function(some_arg=var_1)
  else:
      some_function()
  </code></pre>
  
  <p>The function <code>some_function()</code> does not accept setting <code>some_arg</code> to None so I can only call the function with the named argument if I have a valid value for it.</p>
  
  <p>The reason why the above is less desirable for me is that the actual function calls I'm making have a bunch (5+) of named arguments that I set. This results in repeating mostly similar function calls that differ by only one parameter. </p>
  
  <p>Is there a better way/more Pythonic way to do this? I wish I could call the function and set all possible named parameters that I might wish to pass but, at runtime, only pass in the values that I actually have something for. </p>
  
  <p>In case it matters, the function calls are to the AWS Python SDK (Boto3) so I can't alter the behavior of the function.</p>