MCPcopy Index your code
hub / github.com/python/cpython / why_not_viable

Method why_not_viable

Tools/cases_generator/analyzer.py:218–233  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

216 return self._size
217
218 def why_not_viable(self) -> str | None:
219 if self.name == "_SAVE_RETURN_OFFSET":
220 return None # Adjusts next_instr, but only in tier 1 code
221 if "INSTRUMENTED" in self.name:
222 return "is instrumented"
223 if "replaced" in self.annotations:
224 return "is replaced"
225 if self.name in ("INTERPRETER_EXIT", "JUMP_BACKWARD"):
226 return "has tier 1 control flow"
227 if self.properties.needs_this:
228 return "uses the 'this_instr' variable"
229 if len([c for c in self.caches if c.name != "unused"]) > 2:
230 return "has too many cache entries"
231 if self.properties.error_with_pop and self.properties.error_without_pop:
232 return "has both popping and not-popping errors"
233 return None
234
235 def is_viable(self) -> bool:
236 return self.why_not_viable() is None

Callers 2

is_viableMethod · 0.95
generate_tier2Function · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected