MCPcopy Create free account
hub / github.com/python/mypy / find_unique_signatures

Function find_unique_signatures

mypy/stubdoc.py:519–529  ·  view source on GitHub ↗

Remove names with duplicate found signatures.

(sigs: Sequence[Sig])

Source from the content-addressed store, hash-verified

517
518
519def find_unique_signatures(sigs: Sequence[Sig]) -> list[Sig]:
520 """Remove names with duplicate found signatures."""
521 sig_map: MutableMapping[str, list[str]] = {}
522 for name, sig in sigs:
523 sig_map.setdefault(name, []).append(sig)
524
525 result = []
526 for name, name_sigs in sig_map.items():
527 if len(set(name_sigs)) == 1:
528 result.append((name, name_sigs[0]))
529 return sorted(result)
530
531
532def infer_prop_type_from_docstring(docstr: str | None) -> str | None:

Callers 2

from_doc_dirMethod · 0.90

Calls 6

lenFunction · 0.85
setClass · 0.85
sortedFunction · 0.85
appendMethod · 0.80
setdefaultMethod · 0.80
itemsMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…