Python 2 與 Python 3 的相容性

前幾天 Python 2.7 正式釋出 (2010/07/03),預定是 Python 2 最後一個 major release,於是又有人再討論要怎麼寫出 Python 2 與 Python 3 都能夠跑的程式碼,以維持單一 codebase。

在「The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")」這篇提到了一些語法及模組技巧 (基本上就是用 Python 2 與 Python 3 都可以跑的方式寫),以及當無法避免寫兩次時要怎麼做。

Python 3.0 釋出到現在也一年半了 (2008/12/03),Python 3.1 也一年了 (2009/06/27),而 Python 3.2 alpha1 預定在 8/7 發布... 該準備把現有的 code 丟進 Python 3 測試看看了。

Leave a Reply

Your email address will not be published. Required fields are marked *