python-us
python-us copied to clipboard
District of Columbia doesn't exist in States but exist in states
Setting DC Statehood with an environment variable doesn't not appear to add the district to the STATES list as one would expect from the docs. It is present in the us.states list whether or not DC_STATEHOOD is True.
See behavior below, when DC_STATEHOOD is True
import libraries
import os import us
Set environment variable
os.environ['DC_STATEHOOD'] = '1'
Find DC in states list
states_s=[us.states.DC] states_s
returns [<State:District of Columbia>]
Find DC in STATES list
us.states.STATES
returns [State:Alabama, State:Alaska, State:Arizona, State:Arkansas, State:California, State:Colorado, State:Connecticut, State:Delaware, State:Florida, State:Georgia, State:Hawaii, State:Idaho, State:Illinois, State:Indiana, State:Iowa, State:Kansas, State:Kentucky, State:Louisiana, State:Maine, State:Maryland, State:Massachusetts, State:Michigan, State:Minnesota, State:Mississippi, State:Missouri, State:Montana, State:Nebraska, State:Nevada, <State:New Hampshire>, <State:New Jersey>, <State:New Mexico>, <State:New York>, <State:North Carolina>, <State:North Dakota>, State:Ohio, State:Oklahoma, State:Oregon, State:Pennsylvania, <State:Rhode Island>, <State:South Carolina>, <State:South Dakota>, State:Tennessee, State:Texas, State:Utah, State:Vermont, State:Virginia, State:Washington, <State:West Virginia>, State:Wisconsin, State:Wyoming]
This seems buggy on both the default inclusion of DC in states and the exclusion of DC from STATES when statehood is true. I am using the latest version 2.0.2. Please lmk if there is any other info I can provide.
Thanks!
@depmc232 apologies for the confusion there! The documentation reflected an unreleased version of the us package 😖 but version 3.1.1 was just pushed to PyPI and includes the DC_STATEHOOD flag.
DC will always show up as an attribute of us.states
just because it's the namespace of all types of states, territories, obsolete states, etc. However it should NOT show in STATES
or any of the other convenience lists unless DC_STATEHOOD is set.
Thanks!