This does not work in the case where ``x=[3 * u.m, 4 * u.km]`` since it is neither a quantity nor is ``unit`` set explicitly. This started to get very messy code-wise so I'm going to leave as-is for now, and we can worry about it if this becomes a bottleneck.