Python Descriptors
暫譯: Python 描述符

Jacob Zimmerman

  • 出版商: Apress
  • 出版日期: 2016-12-08
  • 售價: $910
  • 貴賓價: 9.5$865
  • 語言: 英文
  • 頁數: 84
  • 裝訂: Paperback
  • ISBN: 148422504X
  • ISBN-13: 9781484225042
  • 相關分類: Python程式語言
  • 海外代購書籍(需單獨結帳)

商品描述

This short book on Python descriptors is a collection of knowledge and ideas from many sources on dealing with and creating descriptors. And, after going through the things all descriptors have in common, the author explores ideas that have multiple ways of being implemented as well as completely new ideas never seen elsewhere before.

This truly is a comprehensive guide to creating Python descriptors. As a bonus: A pip install-able library, descriptor_tools, was written alongside this book and is an open source library on GitHub.

There aren't many good resources out there for writing Python descriptors, and extremely few books. This is a sad state of affairs, as it makes it difficult for Python developers to get a really good understanding of how descriptors work and the techniques to avoid the big gotchas associated with working with them.

What You Will Learn
  • Discover descriptor protocols
  • Master attribute access and how it applies to descriptors
  • Make descriptors and discover why you should
  • Store attributes
  • Create read-only descriptors and _delete()
  • Explore the descriptor classes
  • Apply the other uses of descriptors and more


Who This Book Is For

Experienced Python coders, programmers and developers.


商品描述(中文翻譯)

這本關於 Python 描述符的短書是來自多個來源的知識和想法的集合,專注於處理和創建描述符。在介紹所有描述符的共同特徵後,作者探討了多種實現方式的想法,以及一些前所未見的全新概念。

這確實是一本全面的 Python 描述符創建指南。作為額外的收穫:一個可通過 pip 安裝的庫 descriptor_tools 與本書一起編寫,並且是一個開源庫,托管在 GitHub 上。

目前市場上關於編寫 Python 描述符的優質資源不多,書籍更是寥寥可數。這是一個令人遺憾的現狀,因為這使得 Python 開發者難以真正理解描述符的運作方式以及避免與之相關的重大陷阱的技術。

**你將學到什麼**

- 探索描述符協議
- 精通屬性訪問及其在描述符中的應用
- 創建描述符並了解為什麼應該這樣做
- 儲存屬性
- 創建只讀描述符和 _delete()
- 探索描述符類別
- 應用描述符的其他用途等

**本書適合誰閱讀**

有經驗的 Python 程式設計師、程序員和開發者。