Error importing plugin "classes.contrib.mypy.classes_plugin" cannot import name 'union_items' from 'mypy.types'
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the Python 3.11 import from the issue and inspect classes/contrib/mypy/typeops/call_signatures.py, where the traceback shows the failing mypy.types import. Check the installed mypy compatibility and verify that importing classes.contrib.mypy.classes_plugin completes without errors.
Written by the indexing model from the issue text.
Description
Bug report
What's wrong
I am hitting the error on a clean installation with python3.11 on MacOS.
Python 3.11.1 (main, Dec 12 2022, 14:17:59) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import classes.contrib.mypy.classes_plugin
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/uname/PycharmProjects/sandbox/.venv/lib/python3.11/site-packages/classes/contrib/mypy/classes_plugin.py", line 33, in <module>
from classes.contrib.mypy.features import associated_type, supports, typeclass
File "/Users/uname/PycharmProjects/sandbox/.venv/lib/python3.11/site-packages/classes/contrib/mypy/features/typeclass.py", line 17, in <module>
from classes.contrib.mypy.typeops import (
File "/Users/uname/PycharmProjects/sandbox/.venv/lib/python3.11/site-packages/classes/contrib/mypy/typeops/call_signatures.py", line 9, in <module>
from mypy.types import TypeVarType, union_items
ImportError: cannot import name 'union_items' from 'mypy.types' (/Users/uname/PycharmProjects/sandbox/.venv/lib/python3.11/site-packages/mypy/types.cpython-311-darwin.so)
How is that should be
No errors
System information
pythonversion:classesversion:mypyversion:
- Dominant language
- Python
- Stars
- 730
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dry-python/classes
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
dry-python/classes#496 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
dry-python/classes#494 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
dry-python/classes#492 · 2 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
dry-python/classes#386 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
dry-python/classes#330 · 1 comment ·
All issues in dry-python/classes
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
browser-use/browser-use#5905 ·
-
type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ynput/ayon-python-api#363 ·
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
modelscope/FunASR#3728 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
open-compass/opencompass#2655 ·