-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about default values in hook implementation #442
Comments
As of now There's no support for default values at all, thus never use them in Hook impls |
krassowski
added a commit
to krassowski/python-lsp-server
that referenced
this issue
Sep 10, 2023
krassowski
added a commit
to krassowski/python-lsp-server
that referenced
this issue
Sep 10, 2023
krassowski
added a commit
to krassowski/python-lsp-server
that referenced
this issue
Sep 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I encountered a somewhat confusing behaviour in python-lsp/python-lsp-server#439 were I observe that the hook implementation default arguments always take precedence over the values passed to the hook at runtime. This can be reproduced using the following snippet:
which prints
[1]
rather than[3]
which I would expect. I see this issue in Python 3.8 and 3.11.I do not see any explanation of this behaviour, which appears highly unexpected on https://pluggy.readthedocs.io/en/latest/ but I also do not see any hook implementations with default values there either. As such I am confused as to whether this is intended behaviour or not. Which is it?
The text was updated successfully, but these errors were encountered: