<p dir="ltr">(Extra copy to the list, since Google Groups breaks the recipient list :P) </p>
<p dir="ltr">inspect.Signature.bind() supports this in Python 3.3+</p>
<p dir="ltr">For earlier versions, Aaron Iles backported the functionality on PyPI as "funcsigs".</p>
<p dir="ltr">You can also just define an appropriate function, call it as f(*args, **kwds) and return the resulting locals() namespace.</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<div class="gmail_quote">On 19 Sep 2013 04:39, "Neil Girdhar" <<a href="mailto:mistersheik@gmail.com">mistersheik@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">As far as I know, the way that arguments are mapped to a parameter specification is not exposed to the programmer.  I suggest adding a PassedArgSpec class having two members: args and kwargs.  Then, inspect.ArgSpec can take an argument specification and decode the PassedArgSpect (putting the right things in the right places) and return a dictionary with everything in its right place.<div>
<br></div><div>I can only think of one use for now, which is replacing "arguments" in the returned tuple of __reduce__ and maybe allowing it to be returned by "__getnewargs__".  It might also be nice to store such argument specifications instead of the pair args, kwargs when storing them in lists.</div>
<div><br></div><div>Best,</div><div><br>Neil</div></div><br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
<br></blockquote></div>