Python開発者はPython 3.10.0の3つのベータ版をリリースしました。10月の最終版 3.10.0 のリリースに備えて、できるだけ早くあなたの Python コードを 3.10 でテストするために、Fedora Linux で最新版を試すことができます。
Fedora Linux への Python 3.10 のインストール
Fedora Linux を使っているなら、公式リポジトリから dnf を使って Python 3.10 をインストールできます:
$ sudo dnf install python3.10
最新のプレリリース版を入手するには、 updates-testing リポジトリを有効にする必要があるかもしれません:
$ sudo dnf install --enablerepo=updates-testing python3.10
より多くのベータ版や リリース候補がリリースされると、Fedora パッケージは更新されます。あなた自身の Python 開発者バージョンをコンパイルする必要はありません。最初のベータから、Python 開発者は新しい機能を追加しません。すでにすべての新しいものを楽しむことができます。
Python 3.10 でのプロジェクトのテスト
Python 3.10を使うにはpython3.10コマンドを実行するか、 組み込みのvenvモジュールtox 、または pipenv poetry 仮想環境を作ります。以下はtoxを使った例です:
$ git clone https://.//.itCloning into 'six'...$ cd six/$ tox -e py013py310 run-test: commands[0] | python -m pytest -rfsxX================== test session starts ===================platform linux -- Python 3., pytest-6.2.4, py-1.10.0, pluggy-0.13.1collected 200 itemstest_six.py ...................................... [ 19%].................................................. [ 44%].................................................. [ 69%].................................................. [ 94%]............ [100%]================== 200 passed in 0.43s ===================________________________ summary _________________________py310: commands succeededcongratulations :)
Python 3.10 新機能
ご覧ください。例えば、 試すことができます:
$ python3.10Python 3. (default, Jun , )[GCC (Red Hat -1)] on linuxType "help", "copyright", "credits" or "license" for more information.>>> point = (3, 10)>>> match point:... case (0, 0):... print("Origin")... case (0, y):... print(f"Y={y}")... case (x, 0):... print(f"X={x}")... case (x, y):... print(f"X={x}, Y={y}")... case _:... raise ValueError("Not a point")X=3, Y=10>>> x>>> y
にご期待ください!
経由:




