The Python Master
The Python Master
About the Book
The Python Master is the culmination of our trilogy covering the core Python language. The material in these books is derived from Sixty North's popular and battle-tested training courses which have led thousands of programmers on a journey to being productive with Python.
Our books, which use Python 3, follow a spiral curriculum: We introduce topics gently and then revisit them on multiple occasions to add the depth required to support your progression as a Python developer. We've worked hard to structure the syllabus to avoid forward references. On only a few occasions do we require you to accept techniques on trust, before explaining them later; where we do, it's to deliberately establish good habits.
Bundles that include this book
Table of Contents
- Errata and Suggestions
- Conventions Used in This Book
- A functioning Python 3.5+ runtime
- Experience with concepts from the previous books
- The Road Goes On Forever
Chapter 1 - Advanced Flow Control
elseclauses on loops
An alternative to loop
- The try..except..else construct
- Emulating switch
- Dispatching on Type
Chapter 2 - Byte Oriented Programming
- Bitwise operators
bytestype in depth
Interpreting byte streams with the
- Memory Views
- Memory-mapped files
Chapter 3 - Object Internals and Custom Attributes
- How are Python objects stored?
Special methods which bypass
- Where are the methods?
Chapter 4 - Descriptors
- A review of properties
- Unravelling the property function
- Implementing a descriptor
- Retrieving descriptors on classes
- Data versus non-data descriptors
Chapter 5 - Instance Creation
- Instance Creation
- Customising allocation
Chapter 6 - Metaclasses
- The class of class objects
- Class allocation and initialisation
- Passing additional arguments to the metaclass
- Metaclass methods and visibility
Fine-grained instantiation control with metaclass
- Practical metaclass examples
- Metaclasses and Inheritance
Chapter 7 - Class decorators
- A first class decorator
- Enforcing constraints with a class decorator
- Enforcing constraints for properties
- Chaining class decorators
Chapter 8 - Abstract Base Classes
- What is an abstract base-class?
- Why are abstract base-classes useful?
- What about duck typing?
- Abstract base-classes in Python
Defining subclasses with
- Non-transitivity of subclass relationships
- Method resolution and virtual base-classes
- Library support for abstract base-classes
- Combining abstractmethod with other decorators
- Propagating abstractness through descriptors
@invariantclass decorator with ABCs
- Afterword: Continue the journey
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them