You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Typeguard version
4.3.0
Python version
3.12.0
What happened?
v4.3.0 added extended checks for Protocols via this commit (no PR for some reason).
Part of this change is to check methods with check_callable. This check enforces that the callable cannot have mandatory keyword-only arguments in its declaration (= keyword-only arguments without default values). However PEP3102 seems to explicitly allow keyword-only arguments without defaults.
I suspect this issue might effect all callable, but for us it now surfaced for protocols.
My question/ask is if someone can provide more background information on why this rule is enforced and how it relates to my understanding of PEP3102.
The underlying reason was that I was shoehorning these checks into Callable[] checks which don't support the notion of keyword-only arguments. I have a fix incoming which adds proper (in theory) method signature checking.
Things to check first
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Typeguard version
4.3.0
Python version
3.12.0
What happened?
v4.3.0 added extended checks for Protocols via this commit (no PR for some reason).
Part of this change is to check methods with
check_callable
. This check enforces that the callable cannot have mandatory keyword-only arguments in its declaration (= keyword-only arguments without default values). However PEP3102 seems to explicitly allow keyword-only arguments without defaults.I suspect this issue might effect all callable, but for us it now surfaced for protocols.
My question/ask is if someone can provide more background information on why this rule is enforced and how it relates to my understanding of PEP3102.
If this is unintentional, we should fix it.
How can we reproduce the bug?
The text was updated successfully, but these errors were encountered: