Inspired by one of the comments in astropy/astropy#1480