Use Python 3.10 or higher to avoid error with unsupported types
@miorel 已经在做这个了。
开始于 2024年8月12日。
评估
这个 Issue 还没有评估数据。
描述
With Python 3.9 in my local setup, I've seen this error when running yarn test:
==================================== ERRORS ====================================
__________________ ERROR collecting src/is_palindrome/test.py __________________
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:972: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
???
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
<frozen importlib._bootstrap_external>:850: in exec_module
???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
???
src/is_palindrome/__init__.py:1: in <module>
def is_palindrome(sequence: list | str) -> bool:
E TypeError: unsupported operand type(s) for |: 'type' and 'type'
=========================== short test summary info ============================
ERROR src/is_palindrome/test.py - TypeError: unsupported operand type(s) for |: 'type' and 'type'
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
To fix it, I had to update Python to 3.11, fix local path and regenerate .venv.
We should:
- update our documentation when we have a chance
- maybe log which version of Python is used
@miorel please add more requirements
- 主要语言
- TypeScript
- 星标
- 20
- 派生
- 12
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
code-chronicles-code/leetcode-curriculum 的其他 Issue
-
enhancement kotlin
难度 2/5 1-3 小时 新手友好度 68/100
-
good first issue tests
难度 1/5 1-3 小时 新手友好度 82/100
-
good first issue tests
难度 2/5 1-3 小时 新手友好度 64/100
-
good first issue tests
难度 2/5 1-3 小时 新手友好度 65/100
-
bug
难度 4/5 3-5 天 新手友好度 30/100
code-chronicles-code/leetcode-curriculum#418 · 1 条评论 ·
查看 code-chronicles-code/leetcode-curriculum 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 条评论 ·