Setting parameter names and defaults in method created at runtime
<p>I need to give an automatically constructed method positional and default parameters. If I didn't care about the parameter names or defaults I would have the method take *args and **kwargs. Here's an example of what I'm trying to do (note that </p>

<pre><code>def make_method(params):
    # Create method that's parameters are defined in params.
    return method

params = {'param1': 'default_value', 'param2': None}
method = make_method(params)
</code></pre>

<p>For each non-None value I want to create a positional argument in method and for each None value I want to create a default parameter.</p>

<p>The problem is that I don't know how to set the parameter names and default values at runtime. I don't want to use *args and **kwars for method since it'd be better to have the signature correct when using help() etc.. Is there any way I can do this?</p>
