Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Use Python 3.10 or higher to avoid error with unsupported types

Aperta
#308 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@miorel ci sta già lavorando.

Dal 12/8/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug enhancement python

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
Lingua principale
TypeScript
Stelle
20
Fork
12
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di code-chronicles-code/leetcode-curriculum

Tutte le issue di code-chronicles-code/leetcode-curriculum

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.