3 ms·
Random: years ago when I was trying to sort out a messy political question for Django's "localflavor" library which handles local phone/address/ID number/etc. t
by ubernostrum 10y ago
Random: years ago when I was trying to sort out a messy political question for Django's "localflavor" library which handles local phone/address/ID number/etc. types (the question: should the independent nations under the Compact of Free Association be considered "US states" for purposes of this library, since the US provides their postal service and assigns them "state" codes?), I snuck in an easter egg.
The solution to the political question was to carefully choose a default set of things which would be accepted as "US states", along with sets of constants describing other options you could plug in. One of those, which still lives today as localflavor.us.us_states.OBSOLETE_STATES, lists codes which once were accepted as "states" by the USPS, but no longer are. One of those is, of course, the abbreviation for the Panama Canal Zone ('CZ'). So if you ever need to send mail back in time to the Canal Zone, Django will help you do it.