2323
2424
2525class Reader :
26- """A pure Python implementation of a reader for the MaxMind DB format. IP
27- addresses can be looked up using the ``get`` method.
26+ """A pure Python implementation of a reader for the MaxMind DB format.
27+
28+ IP addresses can be looked up using the ``get`` method.
2829 """
2930
3031 _DATA_SECTION_SEPARATOR_SIZE = 16
@@ -45,15 +46,15 @@ def __init__(
4546 """Reader for the MaxMind DB file format.
4647
4748 Arguments:
48- database -- A path to a valid MaxMind DB file such as a GeoIP2 database
49- file, or a file descriptor in the case of MODE_FD.
50- mode -- mode to open the database with. Valid mode are:
51- * MODE_MMAP - read from memory map.
52- * MODE_FILE - read database as standard file.
53- * MODE_MEMORY - load database into memory.
54- * MODE_AUTO - tries MODE_MMAP and then MODE_FILE. Default.
55- * MODE_FD - the param passed via database is a file descriptor, not
56- a path. This mode implies MODE_MEMORY.
49+ database: A path to a valid MaxMind DB file such as a GeoIP2 database
50+ file, or a file descriptor in the case of MODE_FD.
51+ mode: mode to open the database with. Valid mode are:
52+ * MODE_MMAP - read from memory map.
53+ * MODE_FILE - read database as standard file.
54+ * MODE_MEMORY - load database into memory.
55+ * MODE_AUTO - tries MODE_MMAP and then MODE_FILE. Default.
56+ * MODE_FD - the param passed via database is a file descriptor, not
57+ a path. This mode implies MODE_MEMORY.
5758
5859 """
5960 filename : Any
@@ -140,7 +141,7 @@ def get(self, ip_address: Union[str, IPv6Address, IPv4Address]) -> Optional[Reco
140141 """Return the record for the ip_address in the MaxMind DB.
141142
142143 Arguments:
143- ip_address -- an IP address in the standard string notation
144+ ip_address: an IP address in the standard string notation
144145
145146 """
146147 (record , _ ) = self .get_with_prefix_len (ip_address )
@@ -153,7 +154,7 @@ def get_with_prefix_len(
153154 """Return a tuple with the record and the associated prefix length.
154155
155156 Arguments:
156- ip_address -- an IP address in the standard string notation
157+ ip_address: an IP address in the standard string notation
157158
158159 """
159160 if isinstance (ip_address , str ):
@@ -326,7 +327,7 @@ class Metadata:
326327
327328 languages : list [str ]
328329 """
329- A list of locale codes supported by the databse .
330+ A list of locale codes supported by the database .
330331 """
331332
332333 node_count : int
@@ -340,7 +341,7 @@ class Metadata:
340341 """
341342
342343 def __init__ (self , ** kwargs ) -> None :
343- """Creates new Metadata object. kwargs are key/value pairs from spec."""
344+ """Create new Metadata object. kwargs are key/value pairs from spec."""
344345 # Although I could just update __dict__, that is less obvious and it
345346 # doesn't work well with static analysis tools and some IDEs
346347 self .node_count = kwargs ["node_count" ]
0 commit comments