-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
I can not assign a value to variable of a type built from the unpacking of another type with the new pythong 3.13 generic syntax #18309
Labels
Comments
As I commented there, this is not just a bug - mypy crashes with a traceback on given snippet. Using current master (#d33cef) I get:
|
@sterliakov what do you mean when you say it is not a bug. It crashes with the new generic syntax. Although i worked with the old one |
He said it is not just a bug: it's a crash, which is worse. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
this code with the old generic syntax works perfectly well
<
there is no problem assigning the value ff tp bis of type RK_functionBIS.
ff take a float , a int and a a int as argument. And the RK_functionBIS take as argument tuple(float,int,int) unpacked
But it fails with the new new generic syntax
error messagee: main.py:17: error: Incompatible types in assignment (expression has type "Callable[[float, int, int], int]", variable has type "Callable[[VarArg(*tuple[*tuple[float, int], int])], int]") [assignment]
note that in both case in can run my code successfully- I am not completely sure this is a bug. Perhaps I just made a mistake but somebody in stackoverflow told me to report it as a bug:
https://stackoverflow.com/questions/79292914/why-does-unpacking-with-the-new-generic-syntax-in-python-3-13-cause-a-mypy-error?noredirect=1#comment139825314_79292914
The text was updated successfully, but these errors were encountered: