Without the ~, you should see 'astropy.coordinates.builtin_systems.AltAz' and with it, you should see 'AltAz' - i.e. when you add it, you say that you only want to see the last part of the path.