Skip to content

Commit 9c97336

Browse files
committed
Minor cleanup
1 parent 841bea8 commit 9c97336

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

maxminddb/decoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _decode_utf8_string(self, size, offset):
9797
new_offset = offset + size
9898
return self._buffer[offset:new_offset].decode('utf-8'), new_offset
9999

100-
_type_dispatch = {
100+
_type_decoder = {
101101
1: _decode_pointer,
102102
2: _decode_utf8_string,
103103
3: _decode_packed_type(b'!d', 8), # double,
@@ -128,7 +128,7 @@ def decode(self, offset):
128128

129129
(size, new_offset) = self._size_from_ctrl_byte(
130130
ctrl_byte, new_offset, type_num)
131-
return self._type_dispatch[type_num](self, size, new_offset)
131+
return self._type_decoder[type_num](self, size, new_offset)
132132

133133
def _read_extended(self, offset):
134134
(next_byte,) = struct.unpack(b'!B', self._buffer[offset:offset + 1])

maxminddb/reader.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Reader(object):
1919

2020
"""
2121
Instances of this class provide a reader for the MaxMind DB format. IP
22-
addresses can be looked up using the <code>get</code> method.
22+
addresses can be looked up using the ``get`` method.
2323
"""
2424

2525
_DATA_SECTION_SEPARATOR_SIZE = 16
@@ -54,12 +54,10 @@ def __init__(self, database):
5454
self._decoder = Decoder(self._buffer, self._metadata.search_tree_size
5555
+ self._DATA_SECTION_SEPARATOR_SIZE)
5656

57-
# XXX - consider making a property
5857
def metadata(self):
5958
"""Return the metadata associated with the MaxMind DB file"""
6059
return self._metadata
6160

62-
# XXX - change to lookup?
6361
def get(self, ip_address):
6462
"""Return the record for the ip_address in the MaxMind DB
6563

0 commit comments

Comments
 (0)