Skip to content

Commit c395e06

Browse files
committed
Correct the type hint on metadata()
1 parent 673e74c commit c395e06

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

HISTORY.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ History
99
* The type hints for the database file in the ``Reader`` constructor have
1010
been expanded to match those specified by ``maxmindb.open_database``. In
1111
particular, ``os.PathLike`` and ``IO`` have been added.
12-
12+
* Corrected the type hint for the ``metadata()`` method on ``Reader``. It
13+
will return a ``maxminddb.extension.Metadata`` if the C extension is being
14+
used.
1315

1416
4.2.0 (2021-05-12)
1517
++++++++++++++++++

geoip2/database.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ def _flat_model_for(
258258
record["prefix_len"] = prefix_len
259259
return model_class(record)
260260

261-
def metadata(self) -> maxminddb.reader.Metadata:
261+
def metadata(
262+
self,
263+
) -> Union[maxminddb.reader.Metadata, "maxminddb.extension.Metadata"]:
262264
"""The metadata for the open database.
263265
264266
:returns: :py:class:`maxminddb.reader.Metadata` object

0 commit comments

Comments
 (0)