Skip to content

Commit 9d4908e

Browse files
committed
🧎‍♀️ Genuflect to the types.
1 parent fd3a0ab commit 9d4908e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

importlib_metadata/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from importlib import import_module
3434
from importlib.abc import MetaPathFinder
3535
from itertools import starmap
36-
from typing import Any, Iterable, List, Mapping, Optional, Set, cast
36+
from typing import Any, Iterable, List, Mapping, Match, Optional, Set, cast
3737

3838
__all__ = [
3939
'Distribution',
@@ -180,7 +180,7 @@ def load(self) -> Any:
180180
is indicated by the value, return that module. Otherwise,
181181
return the named object.
182182
"""
183-
match = self.pattern.match(self.value)
183+
match = cast(Match, self.pattern.match(self.value))
184184
module = import_module(match.group('module'))
185185
attrs = filter(None, (match.group('attr') or '').split('.'))
186186
return functools.reduce(getattr, attrs, module)
@@ -769,6 +769,7 @@ class Lookup:
769769
"""
770770
A micro-optimized class for searching a (fast) path for metadata.
771771
"""
772+
772773
def __init__(self, path: FastPath):
773774
"""
774775
Calculate all of the children representing metadata.

0 commit comments

Comments
 (0)