I encountered a somewhat confusing behaviour in https://github.com/python-lsp/python-lsp-server/issues/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?
I encountered a somewhat confusing behaviour in https://github.com/python-lsp/python-lsp-server/issues/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?