astropy/astropy — pull request #1394 by astrofrog (2013-09-02 08:17:12+00:00)
Title: Improved error message for WCS when incorrect number of arguments is passed

Before:

```
In [3]: w.wcs_world2pix(1,2,3,1)
[traceback]
TypeError: Expected 2 or 3 arguments, 4 given
```

After:

```
In [3]: w.wcs_world2pix(1,2,3,1)
[traceback]
TypeError: WCS projection has 2 dimensions, so expected 2 (an Nx2 array and the origin argument) or 3 arguments (the position in each dimension, and the origin argument). Instead, 4 arguments were given.```

Several users have pointed out that the original error message is not very informative.