Skip to content
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

trio_typing 0.10.0 mypy plugin incompatible with mypy 1.11.2 #95

Open
Hnasar opened this issue Aug 25, 2024 · 1 comment · May be fixed by #97
Open

trio_typing 0.10.0 mypy plugin incompatible with mypy 1.11.2 #95

Hnasar opened this issue Aug 25, 2024 · 1 comment · May be fixed by #97
Labels
bug Something isn't working

Comments

@Hnasar
Copy link
Contributor

Hnasar commented Aug 25, 2024

Mypy 1.11 changed some internal API and now TypeVars need a TypeVarId not just an int.
See python/mypy#17671

lib/python3.10/site-packages/trio-stubs/__init__.pyi:135: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.11.2
Traceback (most recent call last):
  File "mypy/checker.py", line 591, in accept
  File "mypy/nodes.py", line 929, in accept
  File "mypy/checker.py", line 5001, in visit_decorator
  File "mypy/checker.py", line 5028, in visit_decorator_inner
  File "mypy/checkexpr.py", line 1561, in check_call
  File "mypy/checkexpr.py", line 1803, in check_callable_call
  File "mypy/checkexpr.py", line 1241, in apply_function_plugin
  File "lib/python3.10/site-packages/trio_typing/plugin.py", line 464, in takes_callable_and_args_callback
    TypeVarType(
  File "mypy/types.py", line 604, in __init__
TypeError: mypy.types.TypeVarId object expected; got int
lib/python3.10/site-packages/trio-stubs/__init__.pyi:135: : note: use --pdb to drop into pdb
@TeamSpen210 TeamSpen210 added the bug Something isn't working label Aug 26, 2024
@jakkdl
Copy link
Member

jakkdl commented Aug 27, 2024

Note that trio-typing is mostly obsolete currently, with the main trio package having incorporated type hints. The only thing that trio-typing adds is typing of Nursery.start, see #75 (comment)
I think the main package has better type hints in several cases, so I would recommend solely using it.

@Redoubts Redoubts linked a pull request Sep 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants