astropy/astropy — pull request #529 by astrofrog (2012-12-04 20:39:59+00:00)
Title: Possible implementation of constants as quantities

This is a possible implementation of the Constant class as a Quantity sub-class. This requires storing the constants in an intermediate ``ConstantDefinition`` class that lives inside ``astropy.units``. The non-quantity constants are still available. Example:

```
# Access original constants
>>> from astropy.constants.si import G
>>> G
6.67384e-11
>>> from astropy.constants.cgs import G
>>> G
6.673840000000001e-08

# Access quantity object
>>> from astropy.constants import G
>>> G

# Fun with constants
>>> from astropy.constants import *
>>> G * au**2 / pc * k_B

```

This needs some tidying up, docs, and tests, but I won't do those until we know whether this is the approach we want to follow.