Skip to content

Argument missing for parameter "f" Pylance [reportCallIssue] #511

Open
@kler

Description

@kler
  • Python State Machine version: 2.5.0
  • Python version: Python 3.13.1 (also reproduced in Python 3.10.12)
  • Operating System: Darwin arm64 24.1.0
  • Visual Studio Code
    Version: 1.96.0 (Universal)
    Commit: 138f619c86f1199955d53b4166bef66ef252935c
    Date: 2024-12-11T02:29:09.626Z
    Electron: 32.2.6
    ElectronBuildId: 10629634
    Chromium: 128.0.6613.186
    Node.js: 20.18.1
    V8: 12.8.374.38-electron.0
    OS: Darwin arm64 24.1.0
  • Pylance language server 2024.12.1 (pyright version 1.1.389, commit ce1325fc)

Description

I apologize in advance if this is outside scope of this project.

Since python-statemachine v2.5.0 VS Code displays a warning on lines executing transitions:

sm = PylanceWarningStateMachine()
sm.run() # <-- this line

The warning is:

image

Argument missing for parameter "f" Pylance reportCallIssue

I haven't figured out how Pylance gets to this conclusion. The f must come from statemachine/transition_mixin.py, which is the only file referencing a parameter named f.

What I also have noticed is that this warning doesn't appear in a VS Code vanilla configuration, but only after certain settings are made.

For instance adding this to the project's pyproject.toml will make VS Code display the warning:

[tool.pyright]
exclude = [
    "**/data",
    "**/__pycache__"
]

In fact, just add this line will make VS Code display the warning:

[tool.pyright]

Again, perhaps this is a bug in Pylance / Pyright for what I know, but the warning did not appear in v2.4.0. So in case you have an idea how to mitigate it, by changing the code or IDE setup, please share your thoughts :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions