Skip to content

Commit 21c49c3

Browse files
committed
ADD town deprecated property
1 parent 1647688 commit 21c49c3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

pyPostcode/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import json
1616
import logging
17+
from warnings import warn
1718

1819

1920
__version__ = '0.5'
@@ -221,6 +222,12 @@ def postcode(self):
221222
def city(self):
222223
return self._data.get('city')
223224

225+
@property
226+
def town(self):
227+
warn('Use the attribute "city" instead',
228+
DeprecationWarning, stacklevel=2)
229+
return self.city
230+
224231
@property
225232
def municipality(self):
226233
return self._data.get('municipality')

0 commit comments

Comments
 (0)