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

Function import_priority

mypy/build.py:623–632  ·  view source on GitHub ↗

Compute import priority from an import node.

(imp: ImportBase, toplevel_priority: int)

Source from the content-addressed store, hash-verified

621
622
623def import_priority(imp: ImportBase, toplevel_priority: int) -> int:
624 """Compute import priority from an import node."""
625 if not imp.is_top_level:
626 # Inside a function
627 return PRI_LOW
628 if imp.is_mypy_only:
629 # Inside "if MYPY" or "if typing.TYPE_CHECKING"
630 return max(PRI_MYPY, toplevel_priority)
631 # A regular import; priority determined by argument.
632 return toplevel_priority
633
634
635def load_plugins_from_config(

Callers 1

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…