Skip to content

Commit 957e991

Browse files
Avasamabravalheri
authored andcommitted
Add type annotations to moved definitions
1 parent 94f0089 commit 957e991

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pkg_resources/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import time
2828
import re
2929
import types
30-
from typing import Any, Dict, List, Protocol
30+
from typing import Any, Callable, Dict, Iterable, List, Protocol, Optional
3131
import zipfile
3232
import zipimport
3333
import warnings
@@ -2021,7 +2021,9 @@ def __init__(self, importer):
20212021
self._setup_prefix()
20222022

20232023

2024-
_distribution_finders = {}
2024+
_distribution_finders: Dict[
2025+
type, Callable[[object, str, bool], Iterable["Distribution"]]
2026+
] = {}
20252027
_declare_state('dict', _distribution_finders=_distribution_finders)
20262028

20272029

@@ -2195,9 +2197,11 @@ def resolve_egg_link(path):
21952197

21962198
register_finder(importlib.machinery.FileFinder, find_on_path)
21972199

2198-
_namespace_handlers = {}
2200+
_namespace_handlers: Dict[
2201+
type, Callable[[object, str, str, types.ModuleType], Optional[str]]
2202+
] = {}
21992203
_declare_state('dict', _namespace_handlers=_namespace_handlers)
2200-
_namespace_packages = {}
2204+
_namespace_packages: Dict[Optional[str], List[str]] = {}
22012205
_declare_state('dict', _namespace_packages=_namespace_packages)
22022206

22032207

0 commit comments

Comments
 (0)