MCPcopy Index your code
hub / github.com/python/mypy / get_prefix

Function get_prefix

mypy/util.py:354–356  ·  view source on GitHub ↗

Drop the final component of a qualified name (e.g. ('x.y' -> 'x').

(fullname: str)

Source from the content-addressed store, hash-verified

352
353
354def get_prefix(fullname: str) -> str:
355 """Drop the final component of a qualified name (e.g. ('x.y' -> 'x')."""
356 return fullname.rsplit(".", 1)[0]
357
358
359def correct_relative_import(

Callers 2

snapshot_symbol_tableFunction · 0.90

Calls 1

rsplitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…