astropy/astroquery — pull request #204 by keflavich (2013-09-05 19:35:43+00:00)
Title: Preserve the argspec of decorated functions in order to make docs/help look nicer

This updates `class_or_instance` to preserve the callspec of the function that is decorated.

It works great for docs!
```
>>> ALFALFA.query_region?
Type: function
String Form:
File: Dynamically generated function. No source code available.
Definition: ALFALFA.query_region(coordinates, radius='', optical_counterpart=False)
Docstring:
Perform object cross-ID in ALFALFA.
```

It works badly for the code, though:
```
>>> ALFALFA.query_region('M31')
ERROR: ValueError: Invalid character at col 0 in angle u'' [astropy.coordinates.angle_utilities]
```

The problem is that the argspec is actually used to define the function, so `radius=''` is actually being passed to the function, which obviously won't work. I need some help figuring out a workaround that will allow the "observed" argspec to change, but preserve the original/real argspec - i.e., change the argspec, but not use it when calling the decorated function...