Replies: 1 comment 1 reply
-
When you say "set the Python version is set to If you want to provide a more specific version in the config file, you can do so. For example, if you are targeting version "3.8.1" or "3.8.0.final.2", you can specify those versions in the config. However, if you specify only "3.8", pyright will assume wildcard values for the remaining unspecified components "3.8.?.?.?". |
Beta Was this translation helpful? Give feedback.
-
Consider the following example:
Code sample in pyright playground
When the Python version is set to
3.8
, pyright infers the first code path as being reachable. However, at runtime,sys.version_info <= (3, 8)
evaluates toFalse
(even when the micro version is0
). Only when comparingsys.version_info <= (3, 8, 0, "final", 0)
it will evaluate toTrue
.Is this expected behavior from pyright?
Beta Was this translation helpful? Give feedback.
All reactions