Python 2 and 3 Compatibility: With Six and Python-Future Libraries

Joannah Nanjekye

  • 出版商: Apress
  • 出版日期: 2017-12-08
  • 售價: $1,350
  • 貴賓價: 9.5$1,283
  • 語言: 英文
  • 頁數: 129
  • 裝訂: Paperback
  • ISBN: 1484229541
  • ISBN-13: 9781484229545
  • 相關分類: Python程式語言
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

商品描述

Discover clean ways to write code that will run on both Python 2 and 3.This book is tutorial-oriented with detailed examples of how to convert existing Python 2-compatible code to code that will run reliably on both Python 2 and 3. 

Although Python 3 is considered the future of Python, Python 2.x will be maintained for several more years, alongside Python 3, which is not backwards compatible. For those who need to support both versions, this book guides you through the process. 

Python 2 and 3 Compatibility explains the syntactical differences between Python 2 and 3, and how to use Python packages Python-Future and Six to implement neutral compatibility. Developers working on either small, medium, or large projects will appreciate the author's clear explanations, detailed examples, and clean techniques to help them extend support for both versions to their existing Python 2-compatible projects.

What You'll Learn

  • Understand the syntactical differences between Python 2 and 3
  • Use the Six and Future Libraries
  • Review the new features in Python 3
  • Choose which Python versions to support when doing neutral support
  • Decide on whether to port or provide support for both versions

Who This Book Is For

Professional Python developers and enthusiasts that want to implement Python 3 support for their existing Python 2 compatible code.

商品描述(中文翻譯)

本書以教學為導向,詳細示範如何將現有的Python 2相容程式碼轉換為可在Python 2和3上可靠運行的程式碼。儘管Python 3被視為Python的未來,但Python 2.x將在未來數年內繼續維護,並與不向後相容的Python 3並行存在。對於需要支援兩個版本的人來說,本書將引導您完成這個過程。

《Python 2 and 3 Compatibility》解釋了Python 2和3之間的語法差異,以及如何使用Python-Future和Six這兩個Python套件來實現中立相容性。無論是從事小型、中型還是大型項目的開發人員,都會喜歡作者清晰的解釋、詳細的示例和乾淨的技巧,以幫助他們將對現有Python 2相容項目的支援擴展到兩個版本。

你將學到什麼:
- 理解Python 2和3之間的語法差異
- 使用Six和Future庫
- 回顧Python 3的新功能
- 在進行中立支援時選擇要支援的Python版本
- 決定是移植還是為兩個版本提供支援

適合閱讀對象:
專業的Python開發人員和愛好者,希望為現有的Python 2相容程式碼實現Python 3支援的人。