Skip to content

Commit

Permalink
Add type annotations to moved definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored and abravalheri committed May 7, 2024
1 parent 94f0089 commit 957e991
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import time
import re
import types
from typing import Any, Dict, List, Protocol
from typing import Any, Callable, Dict, Iterable, List, Protocol, Optional
import zipfile
import zipimport
import warnings
Expand Down Expand Up @@ -2021,7 +2021,9 @@ def __init__(self, importer):
self._setup_prefix()


_distribution_finders = {}
_distribution_finders: Dict[
type, Callable[[object, str, bool], Iterable["Distribution"]]
] = {}
_declare_state('dict', _distribution_finders=_distribution_finders)


Expand Down Expand Up @@ -2195,9 +2197,11 @@ def resolve_egg_link(path):

register_finder(importlib.machinery.FileFinder, find_on_path)

_namespace_handlers = {}
_namespace_handlers: Dict[
type, Callable[[object, str, str, types.ModuleType], Optional[str]]
] = {}
_declare_state('dict', _namespace_handlers=_namespace_handlers)
_namespace_packages = {}
_namespace_packages: Dict[Optional[str], List[str]] = {}
_declare_state('dict', _namespace_packages=_namespace_packages)


Expand Down

0 comments on commit 957e991

Please sign in to comment.