Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

Unverified details These details have not been verified by PyPI Project links Homepage Source Meta License: OSI Approved, MIT License (MIT) Author: Ed Schofield Tags future, past, python3, migration, futurize, backport, six, 2to3, modernize, pasteurize, 3to2 Requires: Python >=2.6, !=3.0.*, !=3.1.*, !=3.2.* future is the missing compatibility layer between Python 2 and Python 3. It allows you to u
Python 3 Module of the Week¶ PyMOTW-3 is a series of articles written by Doug Hellmann to demonstrate how to use the modules of the Python 3 standard library. It is based on the original PyMOTW series, which covered Python 2.7. See About Python Module of the Week for details including the version of Python and tools used.
Cheat Sheet: Writing Python 2-3 compatible code¶ Copyright (c): 2013-2024 Python Charmers, Australia. Author: Ed Schofield. Licence: Creative Commons Attribution. A PDF version is here: https://python-future.org/compatible_idioms.pdf This notebook shows you idioms for writing future-proof code that is compatible with both versions of Python: 2 and 3. It accompanies Ed Schofield’s talk at PyCon AU
Six: Python 2 and 3 Compatibility Library� Six provides simple utilities for wrapping over differences between Python 2 and Python 3. It is intended to support codebases that work on both Python 2 and 3 without modification. six consists of only one Python file, so it is painless to copy into a project. Six can be downloaded on PyPi. Its bug tracker and code hosting is on BitBucket. The name, “six
概要 With Python 3 being the future of Python while Python 2 is still in active use, it is good to have your project available for both major releases of Python. This guide is meant to help you figure out how best to support both Python 2 & 3 simultaneously. もしあなたが標準 Python ライブラリではなく拡張ライブラリでの移植手段を探しているならば Python 3 への拡張モジュール移植 を参照してください。 If you would like to read one core Python developer’s take on w
2011/12/25まで全25エントリつながりました。 参加していただいたみなさん。ありがとうございました! 今年もAdvent Calendarの季節がやってきました。 12/1から、順番に1日1エントリ書いて行ってクリスマスを迎えましょう! どんな内容を書けばいいの? Python3に関係していればなんでもオーケーです。 これまで二の足を踏んでいた方たちも、これを機会にPython3を触ってみてはどうでしょう。 ネタ例 Python3のここがすごいPython3から2にバックポートされたライブラリPython3で動かしてみたPython2からPython3へのポーティング 流れ まずは、このイベントに参加しましょう。俺はこのネタじゃないと書けない!という人はコメントで主張しておきましょう。指名された翌日にブログのエントリを書きましょう。都合が悪い場合は、代わりの人を探してください。次の
Python3には、2系で作られたコードを3用に変換する案をパッチを生成する2to3というコマンドラインツールが付属してます(本体はlib2to3という標準モジュール群)。たとえば、エンコード引数つきのunicode関数でも、そのままエンコード引数が存在しないstr関数に変えるなど、変換も完璧ではないけれど、たいていのコードは3で動くようになります。 しかし、変換してしまうとそのコードは2系では動かなくなります。ということで、2系でも3でも両方で動くようなコードを書くのはどうすればいいか、を考えてみました。 両方で動くようにするには、ない機能を使うわけには行かないので、どうしても共通部分のみでかかざろうえません。なのでお勧めはできないのですけど、一応両方で動かす前提で書くことを考えてみました。 print 関数風にカッコつき呼び出しにする(ただしprintのみの一行で) print(obj
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く