Skip to content

Commit 5314e57

Browse files
committed
Add type for latest_info and fix return type for iter_packages_latest_infos
1 parent 02b3c68 commit 5314e57

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pip/_internal/commands/list.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
if MYPY_CHECK_RUNNING:
2727
from optparse import Values
28-
from typing import Any, List, Set, Tuple
28+
from typing import Any, List, Set, Tuple, Iterator
2929

3030
from pip._internal.network.session import PipSession
3131
from pip._vendor.pkg_resources import Distribution
@@ -199,11 +199,12 @@ def get_not_required(self, packages, options):
199199
return list({pkg for pkg in packages if pkg.key not in dep_keys})
200200

201201
def iter_packages_latest_infos(self, packages, options):
202-
# type: (List[Distribution], Values) -> Distribution
202+
# type: (List[Distribution], Values) -> Iterator[Distribution]
203203
with self._build_session(options) as session:
204204
finder = self._build_package_finder(options, session)
205205

206206
def latest_info(dist):
207+
# type: (Distribution) -> Distribution
207208
typ = 'unknown'
208209
all_candidates = finder.find_all_candidates(dist.key)
209210
if not options.pre:

0 commit comments

Comments
 (0)