What's a good way to provide additional decoration/metadata for Python function parameters?
<p>We're considering using Python (IronPython, but I don't think that's relevant) to provide a sort of 'macro' support for another application, which controls a piece of equipment.</p>

<p>We'd like to write fairly simple functions in Python, which take a few arguments - these would be things like times and temperatures and positions.   Different functions would take different arguments, and the main application would contain user interface (something like a property grid) which allows the users to provide values for the Python function arguments.</p>

<p>So, for example function1 might take a time and a temperature, and function2 might take a position and a couple of times.</p>

<p>We'd like to be able to dynamically build the user interface from the Python code.  Things which are easy to do are to find a list of functions in a module, and (using inspect.getargspec) to get a list of arguments to each function.</p>

<p>However, just a list of argument names is not really enough - ideally we'd like to be able to include some more information about each argument - for instance, it's 'type' (high-level type - time, temperature, etc, not language-level type), and perhaps a 'friendly name' or description.</p>

<p>So, the question is, what are good 'pythonic' ways of adding this sort of information to a function.</p>

<p>The two possibilities I have thought of are:</p>

<ul>
<li><p>Use a strict naming convention for arguments, and then infer stuff about them from their names (fetched using getargspec)</p></li>
<li><p>Invent our own docstring meta-language (could be little more than CSV) and use the docstring for our metadata.</p></li>
</ul>

<p>Because Python seems pretty popular for building scripting into large apps, I imagine this is a solved problem with some common conventions, but I haven't been able to find them.</p>
