| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
`system_executable` holds `None` between construction and `resolve_to_system`, so a consumer reading it after discovery must narrow a value that resolution has settled. virtualenv carries ten identical ty suppressions for this one gap. `system_exe` falls back to `executable`, the value resolution writes when a prefix links back to its own interpreter, and the anchor `iter_interpreters` uses for deduplication. It joins `system_prefix` and `system_exec_prefix` as a narrowed reader of the system interpreter.
| Back | FazBrowse Home | New Git URL |
PythonInfo.system_executable has type str | None, because _fast_get_system_executable() gives up on a virtual environment whose base it cannot determine by inspection. resolve_to_system() then walks the prefix chain and fills the field in, and every discovery entry point runs it before handing a PythonInfo out. 🔍 The annotation cannot express that ordering, so a consumer reading the field past discovery has to narrow a value resolution has settled. virtualenv carries eleven ty: ignore suppressions doing just that, spread across its CPython, PyPy, GraalPy and RustPython creators, and pypa/virtualenv#3223 adds a twelfth.
system_exe gives those callers a reader typed str. It falls back to executable, which carries type str, so the property needs no suppression of its own rather than relocating one out of virtualenv. ✨ This repository follows that same fallback in two other spots. resolve_to_system() writes it when a prefix links back to its own interpreter, and _discovery.py anchors deduplication on it, which docs/explanation.rst records as how iteration skips candidates it has seen. The property sits beside system_prefix and system_exec_prefix, which cover real_prefix or base_prefix or prefix the same way.
Nothing existing changes, since this only adds a reader. _discovery.py could use it too, but the is None guard there cannot fire given executable: str, and untangling that dead branch belongs in its own change.