MCPcopy Index your code
hub / github.com/python/typing / get_overloads

Function get_overloads

typing_extensions/src/typing_extensions.py:307–316  ·  view source on GitHub ↗

Return all defined overloads for *func* as a sequence.

(func)

Source from the content-addressed store, hash-verified

305 return _overload_dummy
306
307 def get_overloads(func):
308 """Return all defined overloads for *func* as a sequence."""
309 # classmethod and staticmethod
310 f = getattr(func, "__func__", func)
311 if f.__module__ not in _overload_registry:
312 return []
313 mod_dict = _overload_registry[f.__module__]
314 if f.__qualname__ not in mod_dict:
315 return []
316 return list(mod_dict[f.__qualname__].values())
317
318 def clear_overloads():
319 """Clear all overloads in the registry."""

Callers 2

Calls

no outgoing calls

Tested by 2