Skip to content

Commit 69e5d31

Browse files
committed
Clarify docstring for extract_module_names
1 parent 4a7a231 commit 69e5d31

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mypy/indirection.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
from mypy.util import split_module_names
1010

1111

12-
def extract_module_names(symbol_name: str) -> Iterable[str]:
13-
"""Return the module and parent modules of a fully qualified symbol name."""
14-
if symbol_name is not None:
15-
while '.' in symbol_name:
16-
symbol_name = symbol_name.rsplit('.', 1)[0]
17-
yield symbol_name
12+
def extract_module_names(type_name: Optional[str]) -> Iterable[str]:
13+
"""Returns the module name of a fully qualified type name."""
14+
if type_name is not None:
15+
while '.' in type_name:
16+
type_name = type_name.rsplit('.', 1)[0]
17+
yield type_name
1818

1919

2020
class TypeIndirectionVisitor(TypeVisitor[Set[str]]):

0 commit comments

Comments
 (0)