About the Course
This 2-day advanced Python course will provide the students with skills and techniques for flow control, including emulating the switch statement. You will also learn the methods of working with bytes and the internals of objects. In addition, this course revisits and thoroughly explores descriptors, metaclasses, class decorators, and abstract base classes, among others, giving you a comprehensive understanding of the Python language.
Who should do this course?
This course is ideal for those who would like to learn more advanced skills on various techniques, shortcuts, and tips for writing more professional python code. It will lead you on from being a competent programmer to becoming a master.
This course assumes you have completed our beginner and intermediate Python courses or equivalent experience and a solid understanding of all of the programming and object-oriented principles in Python. This includes lambda expressions, decorators and closures, and iterations, mapping, filtering, and the reduce function. You will also need to be familiar with implementing collection protocols, custom context managers, and introspection
Expand full topic list
Unit 1: Advanced Flow Control
- Using else Clauses on Loops
- Investigating an Alternative to Loop else Clauses
- Using the try..except..else Construct
- Emulating Switch
- Dispatching on Type
Unit 2: Byte Oriented Programming
- Understanding Bitwise Operators
- Investigating the Bytes Type in Depth
- Using the Mutable Bytearray Sequence
- Interpreting Byte Streams with the Struct Module
- Using Memory Views
- Using Memory-Mapped Files
Unit 3: Object Internals and Custom Attributes
- Understanding how Python Objects are Stored?
- Using vars() to Access dict
- Overriding getattribute()
- Using Special Methods which Bypass getattribute ()
- Locating the Methods
- Reducing Memory Usage Using Slots
Unit 4: Descriptors
- Reviewing Properties
- Unravelling the Property Function
- Implementing a Descriptor
- Retrieving Descriptors on Classes
- Understanding Data Versus Non-Data Descriptors
Unit 5: Instance Creation
- Understanding Instance Creation
- Customising Allocation
Unit 6: Metaclasses
- Understanding the Object Class
- Understanding how a Class is Allocated and Initialised
- Passing Additional Arguments to the Metaclass
- Investigating Metaclass Methods and Visibility
- Utilising Fine-Grained Instantiation Control with Metaclass Call()
- Examining Practical Metaclass Examples
- Understanding Inheritance in Metaclasses
Unit 7: Class Decorators
- Introducing Class Decorators
- Enforcing Constraints with a Class Decorator
- Enforcing Constraints for Properties
- Chaining Class Decorators
Unit 8: Abstract Base Classes
- Understanding Abstract Base-Classes
- Discussing Why Abstract Base-Classes are Useful?
- Understanding Duck Typing
- Understanding Abstract Base-Classes in Python
- Defining Subclasses with subclasscheck()
- Understanding Non-Transitivity of Subclass Relationships
- Resolving Method Calls in Virtual Base-Classes
- Investigating Library Support for Abstract Base-Classes
- Combining Abstractmethod with other Decorators
- Propagating Abstractness Through Descriptors
- Fixing our @invariant Class Decorator with ABCs
Fill in your details to have a training consultant contact you to discuss your training needs.
Thank you for your enquiry. A consultant will contact with you shortly to assist in your enquiry.
To return to the top of the page, click here.