擅长:python、mysql、java
<p>使用<a href="https://docs.python.org/3.5/library/functions.html#locals" rel="nofollow noreferrer">locals</a>:</p>
<pre><code>>>> def test(*, p1=None, p2=None):
... return locals()
...
>>> test(p2='hello')
{'p1': None, 'p2': 'hello'}
</code></pre>