Python Descriptors [electronic resource] /
Zimmerman, Jacob.author.
This short book is a collection of knowledge and ideas from many sources on dealing with and creating Python descriptors. And, after going through the things all descriptors have in common, author Jacob Zimmerman explores concepts that have multiple ways of being implemented, as well as completely new ideas never seen elsewhere before. Python Descriptors will give you a good understanding of how descriptors work, and teach you techniques that will enable you to avoid the big gotchas associated with working with them. 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. What is a descriptor protocol What is attribute access and how they apply to descriptors How to make descriptors and why Which Methods are needed How to store attributes How to do Read-Only Descriptors and Writing _delete() How to explore the descriptor classes How to apply the other uses of descriptors and more.
Includes bibliographical references and index.
Chapter 1: What is a Descriptor -- Chapter 2: The Descriptor Protocol -- Chapter 3: What Are Descriptors Good For? -- Chapter 4: Descriptors in the Standard Library -- Chapter 5: Attribute Access and Descriptors -- Chapter 6: Which Methods Are Needed? -- Chapter 7: Storing the Attributes -- Chapter 8: Read-Only Descriptors -- Chapter 9: Writing _delete_() -- Chapter 10: Descriptors are Classes Too -- Chapter 11: Reusing the Wheel -- Chapter 12: Other Uses of Descriptors in the World.
This short book is a collection of knowledge and ideas from many sources on dealing with and creating Python descriptors. And, after going through the things all descriptors have in common, author Jacob Zimmerman explores concepts that have multiple ways of being implemented, as well as completely new ideas never seen elsewhere before. Python Descriptors will give you a good understanding of how descriptors work, and teach you techniques that will enable you to avoid the big gotchas associated with working with them. 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. What is a descriptor protocol What is attribute access and how they apply to descriptors How to make descriptors and why Which Methods are needed How to store attributes How to do Read-Only Descriptors and Writing _delete() How to explore the descriptor classes How to apply the other uses of descriptors and more.
Python (Computer program language).
Programming languages (Electronic computers).
Computer programming.
Python.
Programming Languages, Compilers, Interpreters.
Programming Techniques.