The Python Master
This book is 75% complete
Last updated on 2019-01-01
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.
- 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 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...