Add associated states (Marshall Islands, FSM, Palau) as ASSOCIATED_STATES#101
Open
jcarbaugh wants to merge 3 commits into
Open
Add associated states (Marshall Islands, FSM, Palau) as ASSOCIATED_STATES#101jcarbaugh wants to merge 3 commits into
jcarbaugh wants to merge 3 commits into
Conversation
Add entries for the three Compact of Free Association associated states to a new top-level ASSOCIATED_STATES list. These are sovereign nations, not US states or territories, so they are kept out of STATES_AND_TERRITORIES and are not returned by lookup(). A new is_associated boolean on State distinguishes them programmatically, matching the existing is_territory / is_obsolete pattern. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Author
|
Concise summary: adds Federated States of Micronesia, Marshall Islands, and Palau to a new Things worth scrutinizing:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add entries for the three Compact of Free Association associated states — Federated States of Micronesia, Marshall Islands, and Palau — to a new top-level
ASSOCIATED_STATESconstant.These are sovereign nations in free association with the United States, distinct from US states and territories. They get their own list rather than living in
STATES_AND_TERRITORIES, andlookup()does not return them. A newis_associatedboolean onStatedistinguishes them programmatically, matching the existingis_territory/is_obsoletepattern.Closes #61 and #80
What's in the change
StateinstancesFM,MH,PWdefined alphabetically by name inus/states.py, with USPS abbreviations and the historical Census FIPS 5-2 codes (64,68,70).ASSOCIATED_STATES: List[State] = [FM, MH, PW]next toOBSOLETEandTERRITORIES.is_associated: boolattribute onState, set explicitly on every state (Truefor the three new entries,Falsefor everything else).ASSOCIATED_STATESfrom theuspackage.test_attribute,test_valid_timezones, andtest_jellyfish_metaphoneto cover the associated states.test_associated_states_count,test_associated_states_not_in_states_and_territories,test_associated_states_lookup_returns_none, andtest_associated_states_have_is_associated_flag.CHANGELOG.mdandREADME.mdupdated.Why this shape
STATES_AND_TERRITORIES: these jurisdictions are independent countries, so including them would silently change the meaning of every consumer that iterates that list (county totals, FIPS lookups, AP-style helpers).lookup()deliberately ignores them:lookuponly scansSTATES_AND_TERRITORIES, so associated states are unreachable through it by design. The newtest_associated_states_lookup_returns_nonedocuments this so it can't regress silently.is_associatedflag instead of relying on list membership: consistent withis_territoryandis_obsolete, which are also set explicitly on everyStaterather than derived from list membership.Backwards compatibility
STATES,TERRITORIES,STATES_AND_TERRITORIES, andlookup()semantics are unchanged. Addingis_associatedis additive.