-
Notifications
You must be signed in to change notification settings - Fork 114
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
Assigning to *args causes a compile error #330
Comments
This works with 4.0.0rc1. I plan to release the final version soon, as long as there are no showstopper issues. |
So it does. I'm now testing 4.0.0.rc1, and I've encountered a different error in a large project. I'll make a new bug report when I can narrow down the cause. |
Make sure you delete any |
The 4.0.0.rc1 issue was indeed related to |
Yeah. I'm adding a mechanism to typeguard that varies the file name pattern of the generated typeguard-modified .pyc files based on the version information obtained from EDIT: Done in 1715bd7. |
I've found a very similar issue in 4.0.0.rc1 test.py def test(*args: str):
pass Giving any type annotation to *args causes the same error I reported above, but only for Python 3.8. Python 3.10 runs it just fine. |
I've added a new test for both positional and keyword variable arguments, and indeed it fails on Python 3.7 and 3.8. Good thing this was caught before the final release. |
I also keep running into that issue in https://github.com/python-adaptive/adaptive/.
What is your idea of "soon"? 😄 |
My plan was to release it next week, provided that no other showstopper issues crop up. |
So, turns out that on Python 3.8 and earlier, you can't assign |
The fix is available in v4.0.0rc2. |
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
3.0.2
Python version
3.8.10, 3.10.11
What happened?
It errors during compile. It should not error during compile
How can we reproduce the bug?
test.py
typecheck.py
run typecheck.py
Python 3.8:
Python 3.10:
The text was updated successfully, but these errors were encountered: