Skip to content

Commit 442364c

Browse files
committed
changes from 2.0.2
1 parent 412957c commit 442364c

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ Changelog
225225
* added type annotations
226226

227227

228+
2.0.2
229+
~~~~~
230+
231+
* restore DC in lookup() and mapping()
232+
233+
228234
2.0.1
229235
~~~~~
230236

us/states.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def lookup(val, field: Optional[str] = None, use_cache: bool = True) -> Optional
101101
if use_cache and cache_key in _lookup_cache:
102102
matched_state = _lookup_cache[cache_key]
103103

104-
for state in itertools.chain(STATES_AND_TERRITORIES, OBSOLETE):
104+
for state in STATES_AND_TERRITORIES:
105105
if val == getattr(state, field):
106106
matched_state = state
107107
if use_cache:

us/tests/test_us.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_name_lookup():
7070

7171
def test_obsolete_lookup():
7272
for state in us.OBSOLETE:
73-
assert us.states.lookup(state.name) == state
73+
assert us.states.lookup(state.name) is None
7474

7575

7676
# test metaphone
@@ -117,6 +117,13 @@ def test_wayoming():
117117
assert us.states.lookup("Wayoming") is None
118118

119119

120+
def test_dc():
121+
assert us.states.DC not in us.STATES
122+
assert us.states.lookup("DC") == us.states.DC
123+
assert us.states.lookup("District of Columbia") == us.states.DC
124+
assert "DC" in us.states.mapping("abbr", "name")
125+
126+
120127
# shapefiles
121128

122129

0 commit comments

Comments
 (0)