Closed tristanlatr closed 2 years ago
Here is an example where the inference is ambiguous:
from .mod import l as _l
import sys
l = ['f', 'k']
if sys.version_info > (3,8):
l.extend(_l)
To handle these kind of cases I believe we could optionally set a value to the name sys.version_info
(or any name) as a context manager for instance, such that the If.test
condition can be inferred. But it's probably something to add in a second phase of development.
The following code fragment illustrate how we could be able to use the high level inference API:
Feedback welcome :)