microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.7k stars 770 forks source link

Latest release is not flagging errors flagged by the same Pyright version in the CLI #6237

Closed tylerlaprade closed 2 weeks ago

tylerlaprade commented 1 month ago

Environment data

Code Snippet

npx pyright@1.1.373 . -p ../pyrightconfig.json

from decimal import Decimal

class Foo:
    foo: Decimal | None

    def __init__(self, foo: Decimal | None):
        self.foo = foo

records: list[Foo] = [Foo(Decimal(1)), Foo(None)]

Decimal(sum((record.foo or 0) for record in records) if records else 0)

Expected behavior

Pylance should flag the errors that show up in the CLI

image image
/Users/tyler/Code/condor/hanaq/abacus/functions/grid_functions/FOO.py
  /Users/tyler/Code/condor/hanaq/abacus/functions/grid_functions/FOO.py:13:9 - error: No overloads for "sum" match the provided arguments (reportCallIssue)
  /Users/tyler/Code/condor/hanaq/abacus/functions/grid_functions/FOO.py:13:13 - error: Argument of type "Generator[Decimal | int, None, None]" cannot be assigned to parameter "iterable" of type "Iterable[_SupportsSumNoDefaultT@sum]" in function "sum"
    "Generator[Decimal | int, None, None]" is incompatible with "Iterable[Decimal]"
      Type parameter "_T_co@Iterable" is covariant, but "Decimal | int" is not a subtype of "Decimal"
        Type "Decimal | int" is incompatible with type "Decimal"
          "int" is incompatible with "Decimal" (reportArgumentType)

Actual behavior

Pylance doesn't have any errors

image

Logs

2024-08-06 14:32:19.811 [info] [Info  - 2:32:19 PM] (86145) Setting pythonPath for service "condor": "/Users/tyler/Code/condor/.env/bin/python"
2024-08-06 14:32:19.811 [info] [Info  - 2:32:19 PM] (86145) Setting environmentName for service "condor": "3.12.2 (.env venv)"
2024-08-06 14:32:19.823 [info] [Info  - 2:32:19 PM] (86145) Loading configuration file at /Users/tyler/Code/condor/pyrightconfig.json
2024-08-06 14:32:19.839 [info] (86145) Assuming Python platform Darwin
2024-08-06 14:32:19.956 [info] [Info  - 2:32:19 PM] (86145) Search paths for file:///Users/tyler/Code/condor
2024-08-06 14:32:19.956 [info] [Info  - 2:32:19 PM] (86145)   /Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib
2024-08-06 14:32:19.956 [info] [Info  - 2:32:19 PM] (86145)   /Users/tyler/Code/condor
2024-08-06 14:32:19.957 [info] [Info  - 2:32:19 PM] (86145)   /Users/tyler/Code/condor/hanaq
2024-08-06 14:32:19.957 [info] [Info  - 2:32:19 PM] (86145)   /Users/tyler/Code/condor/typings
2024-08-06 14:32:19.957 [info] [Info  - 2:32:19 PM] (86145)   /Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stubs/...
2024-08-06 14:32:19.957 [info] [Info  - 2:32:19 PM] (86145)   /Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/bundled/stubs
2024-08-06 14:32:19.957 [info] [Info  - 2:32:19 PM] (86145)   /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12
2024-08-06 14:32:19.957 [info] [Info  - 2:32:19 PM] (86145)   /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload
2024-08-06 14:32:19.957 [info] [Info  - 2:32:19 PM] (86145)   /Users/tyler/Code/condor/.env/lib/python3.12/site-packages
2024-08-06 14:32:19.957 [info] [Info  - 2:32:19 PM] (86145) Adding fs watcher for library directories:
 file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12
file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload
file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages
2024-08-06 14:32:19.957 [info] [Info  - 2:32:19 PM] (86145) Adding fs watcher for directories:
 file:///Users/tyler/Code/condor/hanaq
2024-08-06 14:32:19.957 [info] (86145) Searching for source files
2024-08-06 14:32:21.721 [info] [Info  - 2:32:21 PM] (86145) Found 485 source files
2024-08-06 14:32:21.766 [info] (86145) No pyproject.toml file found.
2024-08-06 14:32:21.766 [info] [Info  - 2:32:21 PM] (86145) Setting pythonPath for service "<default>": "/Users/tyler/Code/condor/.env/bin/python"
2024-08-06 14:32:21.766 [info] [Info  - 2:32:21 PM] (86145) Setting environmentName for service "<default>": "3.12.2 (.env venv)"
2024-08-06 14:32:21.766 [info] [Info  - 2:32:21 PM] (86145) No include entries specified; assuming /<default workspace root>
2024-08-06 14:32:21.766 [info] [Info  - 2:32:21 PM] (86145) Auto-excluding **/node_modules
2024-08-06 14:32:21.767 [info] [Info  - 2:32:21 PM] (86145) Auto-excluding **/__pycache__
2024-08-06 14:32:21.767 [info] [Info  - 2:32:21 PM] (86145) Auto-excluding **/.*
2024-08-06 14:32:21.803 [info] [Info  - 2:32:21 PM] (86145) Assuming Python version 3.12.2.final.0
2024-08-06 14:32:21.803 [info] (86145) Assuming Python platform Darwin
2024-08-06 14:32:21.952 [info] [Info  - 2:32:21 PM] (86145) Search paths for file:///%3Cdefault%20workspace%20root%3E
2024-08-06 14:32:21.952 [info] [Info  - 2:32:21 PM] (86145)   /Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib
2024-08-06 14:32:21.952 [info] [Info  - 2:32:21 PM] (86145)   /<default workspace root>
2024-08-06 14:32:21.952 [info] [Info  - 2:32:21 PM] (86145)   /<default workspace root>/typings
2024-08-06 14:32:21.952 [info] [Info  - 2:32:21 PM] (86145)   /Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stubs/...
2024-08-06 14:32:21.952 [info] [Info  - 2:32:21 PM] (86145)   /Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/bundled/stubs
2024-08-06 14:32:21.953 [info] [Info  - 2:32:21 PM] (86145)   /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12
2024-08-06 14:32:21.953 [info] [Info  - 2:32:21 PM] (86145)   /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload
2024-08-06 14:32:21.953 [info] [Info  - 2:32:21 PM] (86145)   /Users/tyler/Code/condor/.env/lib/python3.12/site-packages
2024-08-06 14:32:21.953 [info] [Info  - 2:32:21 PM] (86145) Adding fs watcher for library directories:
 file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12
file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload
file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages
2024-08-06 14:32:21.953 [info] [Info  - 2:32:21 PM] (86145) Adding fs watcher for directories:
 file:///%3Cdefault%20workspace%20root%3E
2024-08-06 14:32:21.953 [info] (86145) Searching for source files
2024-08-06 14:32:21.953 [info] [Error - 2:32:21 PM] (86145) File or directory "/<default workspace root>" does not exist.
2024-08-06 14:32:21.953 [info] [Info  - 2:32:21 PM] (86145) No source files found.
2024-08-06 14:32:21.955 [info] (86145) pytest configurations: {"message":"spawn /Users/tyler/Code/condor/.env/bin/python ENOENT","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2024-08-06 14:32:21.955 [info] (86145) Attempting to resolve using local imports: __builtins__
2024-08-06 14:32:21.955 [info] (86145) Attempting to resolve using root path 'file:///Users/tyler/Code/condor/hanaq/abacus/functions/grid_functions'
2024-08-06 14:32:21.955 [info] (86145) Attempting to resolve using root path 'file:///Users/tyler/Code/condor/hanaq/abacus/functions'
2024-08-06 14:32:21.955 [info] (86145) Attempting to resolve using root path 'file:///Users/tyler/Code/condor/hanaq/abacus'
2024-08-06 14:32:21.955 [info] (86145) Attempting to resolve using root path 'file:///Users/tyler/Code/condor/hanaq'
2024-08-06 14:32:21.955 [info] (86145) [BG(1)] analyzing: file:///Users/tyler/Code/condor/hanaq/abacus/functions/grid_functions/direct_fees_or_passthroughs_recon_grid.py ...
2024-08-06 14:32:21.955 [info] (86145) [BG(1)]   parsing: file:///Users/tyler/Code/condor/hanaq/abacus/functions/grid_functions/direct_fees_or_passthroughs_recon_grid.py (131ms)
2024-08-06 14:32:21.956 [info] (86145) [BG(1)]   parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 1ms] (14ms)
2024-08-06 14:32:21.956 [info] (86145) [BG(1)]   binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/builtins.pyi (10ms)
2024-08-06 14:32:21.956 [info] (86145) [BG(1)]   binding: file:///Users/tyler/Code/condor/hanaq/abacus/functions/grid_functions/direct_fees_or_passthroughs_recon_grid.py (1ms)
2024-08-06 14:32:21.958 [info] (86145) [BG(1)]   checking: file:///Users/tyler/Code/condor/hanaq/abacus/functions/grid_functions/direct_fees_or_passthroughs_recon_grid.py ...
2024-08-06 14:32:21.958 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/typing.pyi [fs read 1ms] (12ms)
2024-08-06 14:32:21.962 [info] (86145) [BG(1)]     binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/typing.pyi (2ms)
2024-08-06 14:32:21.967 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/types.pyi [fs read 1ms] (4ms)
2024-08-06 14:32:21.970 [info] (86145) [BG(1)]     binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/types.pyi (2ms)
2024-08-06 14:32:21.972 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi [fs read 1ms] (3ms)
2024-08-06 14:32:21.977 [info] (86145) [BG(1)]     binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi (4ms)
2024-08-06 14:32:21.980 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/abc.pyi [fs read 2ms] (2ms)
2024-08-06 14:32:21.980 [info] (86145) [BG(1)]     binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/abc.pyi (0ms)
2024-08-06 14:32:21.982 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/sys/__init__.pyi [fs read 1ms] (2ms)
2024-08-06 14:32:21.983 [info] (86145) [BG(1)]     binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/sys/__init__.pyi (1ms)
2024-08-06 14:32:22.001 [info] (86145) [BG(1)]     parsing: file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/decimal.py [fs read 4ms] (16ms)
2024-08-06 14:32:22.005 [info] (86145) [BG(1)]     binding: file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/decimal.py ...
2024-08-06 14:32:22.005 [info] (86145) [BG(1)]       parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/_decimal.pyi [fs read 2ms] (4ms)
2024-08-06 14:32:22.006 [info] (86145) [BG(1)]       binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/_decimal.pyi (1ms)
2024-08-06 14:32:22.008 [info] (86145) [BG(1)]       parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/_pydecimal.pyi [fs read 0ms] (1ms)
2024-08-06 14:32:22.008 [info] (86145) [BG(1)]       binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/_pydecimal.pyi (0ms)
2024-08-06 14:32:22.008 [info] (86145) [BG(1)]     binding: file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/decimal.py (7ms)
2024-08-06 14:32:22.009 [info] (86145) pytest configurations: {"message":"spawn /Users/tyler/Code/condor/.env/bin/python ENOENT","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2024-08-06 14:32:22.009 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/decimal.pyi [fs read 1ms] (1ms)
2024-08-06 14:32:22.009 [info] (86145) [BG(1)]     binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/decimal.pyi (0ms)
2024-08-06 14:32:22.026 [info] (86145) [BG(1)]     parsing: file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/typing.py [fs read 2ms] (18ms)
2024-08-06 14:32:22.026 [info] [Info  - 2:32:22 PM] (86145) Could not import '_typing' in file '/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/typing.py'
2024-08-06 14:32:22.027 [info] [Info  - 2:32:22 PM] (86145)   Looking in stubPath 'file:///Users/tyler/Code/condor/typings'
2024-08-06 14:32:22.027 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve stub package using root path 'file:///Users/tyler/Code/condor/typings'
2024-08-06 14:32:22.027 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve using root path 'file:///Users/tyler/Code/condor/typings'
2024-08-06 14:32:22.027 [info] [Info  - 2:32:22 PM] (86145)   Looking in root directory of execution environment 'file:///Users/tyler/Code/condor'
2024-08-06 14:32:22.028 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve stub package using root path 'file:///Users/tyler/Code/condor'
2024-08-06 14:32:22.028 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve using root path 'file:///Users/tyler/Code/condor'
2024-08-06 14:32:22.028 [info] [Info  - 2:32:22 PM] (86145)   Looking in extraPath 'file:///Users/tyler/Code/condor/hanaq'
2024-08-06 14:32:22.028 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve stub package using root path 'file:///Users/tyler/Code/condor/hanaq'
2024-08-06 14:32:22.028 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve using root path 'file:///Users/tyler/Code/condor/hanaq'
2024-08-06 14:32:22.029 [info] [Info  - 2:32:22 PM] (86145)   Looking for typeshed stdlib path
2024-08-06 14:32:22.029 [info] [Info  - 2:32:22 PM] (86145)   Looking for typeshed stdlib path
2024-08-06 14:32:22.029 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve using root path 'file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib'
2024-08-06 14:32:22.029 [info] [Info  - 2:32:22 PM] (86145)   Typeshed path not found
2024-08-06 14:32:22.029 [info] [Info  - 2:32:22 PM] (86145)   Finding python search paths
2024-08-06 14:32:22.029 [info] [Info  - 2:32:22 PM] (86145)   Executing interpreter: '/Users/tyler/Code/condor/.env/bin/python'
2024-08-06 14:32:22.029 [info] [Info  - 2:32:22 PM] (86145)   Skipping '/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python312.zip' because it is not a valid directory
2024-08-06 14:32:22.030 [info] [Info  - 2:32:22 PM] (86145)   Received 3 paths from interpreter
2024-08-06 14:32:22.030 [info] [Info  - 2:32:22 PM] (86145)     file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12
2024-08-06 14:32:22.030 [info] [Info  - 2:32:22 PM] (86145)     file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload
2024-08-06 14:32:22.030 [info] [Info  - 2:32:22 PM] (86145)     file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages
2024-08-06 14:32:22.030 [info] [Info  - 2:32:22 PM] (86145)   Looking in python search path 'file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12'
2024-08-06 14:32:22.030 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve stub package using root path 'file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12'
2024-08-06 14:32:22.031 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve using root path 'file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12'
2024-08-06 14:32:22.031 [info] [Info  - 2:32:22 PM] (86145)   Looking in python search path 'file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload'
2024-08-06 14:32:22.031 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve stub package using root path 'file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload'
2024-08-06 14:32:22.033 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve using root path 'file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload'
2024-08-06 14:32:22.035 [info] [Info  - 2:32:22 PM] (86145)   Looking in python search path 'file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages'
2024-08-06 14:32:22.036 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve stub package using root path 'file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages'
2024-08-06 14:32:22.036 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve using root path 'file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages'
2024-08-06 14:32:22.036 [info] [Info  - 2:32:22 PM] (86145)   Looking in bundled stubs path 'file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/bundled/stubs'
2024-08-06 14:32:22.036 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve stub package using root path 'file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/bundled/stubs'
2024-08-06 14:32:22.036 [info] [Info  - 2:32:22 PM] (86145)   Attempting to resolve using root path 'file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/bundled/stubs'
2024-08-06 14:32:22.036 [info] [Info  - 2:32:22 PM] (86145)   Looking for typeshed third-party path
2024-08-06 14:32:22.036 [info] [Info  - 2:32:22 PM] (86145)   Looking for typeshed stubs path
2024-08-06 14:32:22.036 [info] [Info  - 2:32:22 PM] (86145)   Typeshed path not found
2024-08-06 14:32:22.037 [info] (86145) [BG(1)]     binding: file:///opt/homebrew/Cellar/python%403.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/typing.py (5ms)
2024-08-06 14:32:22.063 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/annoying/functions.py [fs read 11ms] (25ms)
2024-08-06 14:32:22.063 [info] (86145) [BG(1)]     binding: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/annoying/functions.py (0ms)
2024-08-06 14:32:22.066 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/typing_extensions.pyi [fs read 1ms] (3ms)
2024-08-06 14:32:22.067 [info] (86145) [BG(1)]     binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/typing_extensions.pyi (1ms)
2024-08-06 14:32:22.071 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/models/__init__.pyi [fs read 0ms] (1ms)
2024-08-06 14:32:22.072 [info] (86145) [BG(1)]     binding: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/models/__init__.pyi (0ms)
2024-08-06 14:32:22.075 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/models/base.pyi [fs read 0ms] (3ms)
2024-08-06 14:32:22.076 [info] (86145) [BG(1)]     binding: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/models/base.pyi (0ms)
2024-08-06 14:32:22.081 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/models/query.pyi [fs read 1ms] (5ms)
2024-08-06 14:32:22.081 [info] (86145) [BG(1)]     binding: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/models/query.pyi (1ms)
2024-08-06 14:32:22.082 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/__init__.pyi [fs read 0ms] (1ms)
2024-08-06 14:32:22.083 [info] (86145) [BG(1)]     binding: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/__init__.pyi (0ms)
2024-08-06 14:32:22.083 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/collections/abc.pyi [fs read 0ms] (0ms)
2024-08-06 14:32:22.084 [info] (86145) [BG(1)]     binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/collections/abc.pyi ...
2024-08-06 14:32:22.084 [info] (86145) [BG(1)]       parsing: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/_collections_abc.pyi [fs read 0ms] (1ms)
2024-08-06 14:32:22.084 [info] (86145) [BG(1)]       binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/_collections_abc.pyi (0ms)
2024-08-06 14:32:22.084 [info] (86145) [BG(1)]     binding: file:///Users/tyler/.vscode/extensions/ms-python.vscode-pylance-2024.8.1/dist/typeshed-fallback/stdlib/collections/abc.pyi (1ms)
2024-08-06 14:32:22.086 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/models/manager.pyi [fs read 1ms] (1ms)
2024-08-06 14:32:22.086 [info] (86145) [BG(1)]     binding: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/models/manager.pyi (0ms)
2024-08-06 14:32:22.096 [info] (86145) [BG(1)]     parsing: file:///Users/tyler/Code/condor/.env/lib/python3.12/site-packages/django-stubs/db/models/expressions.pyi [fs read 2ms] (9ms)
...
(truncated due to GitHub length limit)
erictraut commented 1 month ago

This error is a false positive. It's due to a regression that I introduced in pyright 1.1.373 (apologies for that). I fixed it in pyright 1.1.374.

heejaechang commented 1 month ago

we will pull in 374 soon for next prelease (this wed probably)

tylerlaprade commented 1 month ago

Sure, no worries @erictraut, bugs happen sometimes. But separately there's a bug in Pylance if it doesn't exhibit the same behavior as the CLI when both are running the same Pyright version. In this case, I have both of them on 1.1.373.

tylerlaprade commented 1 month ago

@heejaechang, outside of this specific error, why is Pylance exhibiting different behavior than Pyright when both are on the same version?

erictraut commented 1 month ago

@tylerlaprade, you may find this documentation useful.

tylerlaprade commented 1 month ago

Thanks @erictraut. I verified that both are indeed using the same underlying Pyright version, and my project has a pyrightconfig.json, so that rules out two of the three possible issues. The only one remaining is the stubPath. However, if they were looking at different stubs, I would have seen many more discrepancies in the past. This seems to be isolated to whether or not this particular regression is included.

heejaechang commented 1 month ago

@tylerlaprade we need to take a look. but pylance might have some pyright changes not released yet from pyright. that sometime happens due to how we bring in pyright changes to pylance.

heejaechang commented 2 weeks ago

please re-open if this still repro with the latest pylance with pyright.

tylerlaprade commented 2 weeks ago

This still repros for me. It looks like the pyright version did not get updated in this release: https://github.com/microsoft/pylance-release/blob/main/releases/latest-release.json

debonte commented 2 weeks ago

This still repros for me. It looks like the pyright version did not get updated in this release: https://github.com/microsoft/pylance-release/blob/main/releases/latest-release.json

Please try prerelease. Yesterday's 2024.8.2 release was a hotfix for a crash bug and did not include any other changes (ex. no Pyright upgrade).

tylerlaprade commented 2 weeks ago

Thanks @debonte. Prerelease is pointing at a version of Pyright after the bugfix, so I wouldn't expect it to flag the error regardless. But I'm still getting the discrepancy when on release Pylance and using the same Pyright version for both CLI and Pylance - CLI flags the error (and fails CI), while Pylance doesn't flag the error.

debonte commented 2 weeks ago

As @heejaechang guessed above, Pylance 2024.8.1 (and 2024.8.2) is not exactly on Pyright 1.1.373. The pyright commit hash is https://github.com/microsoft/pyright/commit/ee42447964f776ef94eaf2bd307fd58ffeef0821, which is 11 commits after 1.1.373. We generally try to align Pylance's copy of Pyright exactly on a Pyright release, but this is not always possible.

Sorry for the inconvenience.

FWIW, you can see the Pyright commit hash in the Pylance log:

2024-08-27 10:16:30.868 [info] [Info  - 10:16:30 AM] (13992) Pylance language server 2024.8.1 (pyright version 1.1.373, commit ee424479) starting