MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / resolve_import

Function resolve_import

scripts/detect-breaking-changes.py:35–45  ·  view source on GitHub ↗
(obj: griffe.Object | griffe.Alias)

Source from the content-addressed store, hash-verified

33
34
35def resolve_import(obj: griffe.Object | griffe.Alias) -> griffe.Object | griffe.Alias:
36 if not isinstance(obj, griffe.Alias) or not obj.runtime: # `if TYPE_CHECKING:` imports are gone at runtime
37 return obj
38
39 try:
40 target = obj.final_target
41 except griffe.GriffeError:
42 return obj
43
44 # `import pkg.name` stops working when a module is replaced by an import of another module
45 return obj if isinstance(target, griffe.Module) else target
46
47
48def public_members(obj: griffe.Object | griffe.Alias) -> dict[str, griffe.Object | griffe.Alias]:

Callers 1

find_breaking_changesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected