-
-
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
Crash with recursive types #14000
Labels
Comments
cc @ilevkivskyi |
#14007 should fix this. Btw @dvarrazzo this type looks suspicious:
Probably you wanted something like DumperKey: TypeAlias = Union[type, Tuple["DumperKey", ...]] (which btw is not affected by this bug). |
dvarrazzo
added a commit
to psycopg/psycopg
that referenced
this issue
Nov 4, 2022
Already supported in current Mypy: python/mypy#731. The definition of DumperKey was wrong anyway, in a way causing mypy to crash: see python/mypy#14000.
@ilevkivskyi Thank you for fixing, and you are right: our type definition (a type or an arbitrarily nested tuple of types) was wrong (it was untested, of course). With the type fixed, mypy 0.982 works correctly. |
ilevkivskyi
added a commit
that referenced
this issue
Nov 4, 2022
Fixes #14000 This will introduce some minor perf penalty, but only for code that actually uses recursive types.
svalentin
pushed a commit
that referenced
this issue
Nov 7, 2022
Fixes #14000 This will introduce some minor perf penalty, but only for code that actually uses recursive types.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just notice #731 closed and I thought giving it a go.
Traceback
I tried the same using mypy 0.982 (adding
enable_recursive_aliases = true
inpyproject.toml
) and it segfaults.The text was updated successfully, but these errors were encountered: