MCPcopy Create free account
hub / github.com/python/cpython / _parse_raw_resolved

Method _parse_raw_resolved

Tools/c-analyzer/c_analyzer/info.py:65–85  ·  view source on GitHub ↗
(cls, item, resolved, extra_extra)

Source from the content-addressed store, hash-verified

63
64 @classonly
65 def _parse_raw_resolved(cls, item, resolved, extra_extra):
66 if resolved in (UNKNOWN, IGNORED):
67 return resolved, None
68 try:
69 typedeps, extra = resolved
70 except (TypeError, ValueError):
71 typedeps = extra = None
72 if extra:
73 # The resolved data takes precedence.
74 extra = dict(extra_extra, **extra)
75 if isinstance(typedeps, TypeDeclaration):
76 return typedeps, extra
77 elif typedeps in (None, UNKNOWN):
78 # It is still effectively unresolved.
79 return UNKNOWN, extra
80 elif None in typedeps or UNKNOWN in typedeps:
81 # It is still effectively unresolved.
82 return typedeps, extra
83 elif any(not isinstance(td, TypeDeclaration) for td in typedeps):
84 raise NotImplementedError((item, typedeps, extra))
85 return typedeps, extra
86
87 def __init__(self, item, typedecl=None, **extra):
88 assert item is not None

Callers 1

from_resolvedMethod · 0.80

Calls 1

anyFunction · 0.50

Tested by

no test coverage detected