Repository navigation
fix: support reversed operands in static sys.version_info and platform comparisons - #11947
Peter Hayes (HTMLPETE) wants to merge 3 commits into
Conversation
…m comparisons (microsoft#11927) Signed-off-by: Peter Hayes <344978951+HTMLPETE@users.noreply.github.com>
🔴 Pyright CLI QA —
|
…n evaluation - Add _isPlainStringList to ensure bytes literals and format strings are never evaluated as static string matches - Guard against imaginary numbers in reversed version comparisons (!node.d.leftExpr.d.isImaginary)
|
Thanks Heejae Chang (@heejaechang) for running the QA bot! Here is the breakdown of the flagged cases:
|
|
This PR is a duplicate of #11929, and the author has opened duplicates of other PRs in the past (#11895). The author is encouraged to read the GitHub Acceptable Use Policy for spam and inauthentic activity. |
Closes #11927
This change adds support for reversed binary comparison forms in staticExpressions.ts:
Previously, only expressions with sys.version_info, sys.platform, or os.name on the left-hand side were statically evaluated for reachability and type checking.
Includes regression test coverage in StaticExpression3.