Perhaps it's the similarity of var names which is confusing. It is asymmetric tho.

It stores it in the dict by the unicode of its actual location regardless of repr not by the conversion of the location. This part of the code is say, "if it's a Location, see if we already retrieved this course via its Locator. If so, ignore the Location-based one as obsolete." So, it's baking in my knowledge that Locations are "old" and Locators are "new" and we only migrate courses from Location-based to Locator-based not the other way around.