• $300

Advanced Python objects

Go beyond simple classes and methods. Understand and use everything Python's objects have to offer.

Get this course, and many others, as part of my LernerPython membership, at https://LernerPython.com.

Take your Python objects to the next level.

Already know how to write Python classes and methods? Then you're ready to dig into Python's object-oriented capabilities, striking at the heart of the language.

In this course, I teach you all about Python's objects, going deeper than most courses. In particular, I show you:
  • The many "magic methods" that you can write, including for operator overloading
  • The context manager protocol, and how you use make your objects behave in a "with" statement
  • How to write and use properties
  • The descriptor protocol, and how it explains how methods differ from functions
  • Metaclasses — what they are, and how to (and not to) use them
I walk you through all of this in more than hours of video, spread across 75 separate videos. I also ensure that you check your knowledge with numerous exercises.

If you want to take your Python to the next level, doing more with less code, then this course is for you.

What people say about "Advanced Python objects"

This is by far the most amazing Python course I have taken. It is full 
of advanced information, especially for people who want to take 
their Python skills to next level.

Punit Jain

FAQs

Who should take this course?

This course is aimed at developers with experience writing Python classes, typically for a year or so. If you've taken my "Object-oriented Python" course and have then used those ideas in your development for a few months, then you're probably ready for this course.

What version of Python do you use?

3.7, although I do briefly mention a new feature in 3.8.  (I didn't have 3.8 running on my computer when producing the course.)  

If you have Python 3.6 or above,then you're fine for this course.

Is there a “trial” version or sample?

No, but (a) you can view a number of the videos for free, without purchasing the course, and (b) I offer a 100% guaranteed refund if you need.  

Is automated testing a part of this course?

No, but I am preparing a separate course on "pytest" that will cover functions (among other topics).

I live in Israel. How do you handle issues like VAT?

If you live in Israel, then please don't buy any of my products (including Weekly Python Exercise) via this online platform. I'm obligated to collect VAT from you, and then to pass it along to the government.  Instead, please e-mail me for information about sending me a bank transfer. I'll then add you to the course, but we'll be able to handle it in the standard and legal way. I apologize for this frustration -- believe me, I wish that the platform I use for selling courses would support Israeli VAT, and I keep asking them to do so.

What if I find that the course is too easy or hard, or that I just dislike your jokes?

If you aren't satisfied with my course, then I'll refund your money.  Just e-mail me.  I believe that I'm offering a high-quality product, but I also know that it's not for everyone.

As for the jokes, people have been trying to help me for years. So far, my jokes have just gotten worse, not better. Oh, well.

Do you offer any discounts?

Yes, I offer discounts for students, pensioners/retirees, and anyone living outside of the world's 30 richest countries. E-mail me at reuven@lerner.co.il for an appropriate coupon code.

I have other questions. What should I do?

Contact me at reuven@lerner.co.il, and let's see what I can do.

Contents

01 Welcome

Section 1: Advanced methods

Section 1 -- Advanced methods.ipynb
02 Intro to magic methods
03 Equality with __eq__
Preview
04 Other comparison operators
05 total_ordering
06 The "operator" module
07 Exercises 1
exercises-1.txt
08 Exercise 1 solutions
09 __add__
10 reversing things with __radd__
11 __iadd__
12 Exercises 2
exercises-2.txt
13 Exercise 2 solutions
14 __getitem__
15 operator.itemgetter
Preview
16 __contains__
17 __int__ and __float__
18 __bool__
19 __format__
20 Exercises 3
exercises-3.txt
21 Exercise 3 solutions
22 __del__
23 __getattr__
24 __getattr__ vs getattr
25 __setattr__
26 __slots__
27 __getattribute__
28 Exercises 4
exercises-4.txt
29 Exercise solutions 4
30 Static methods
31 Class methods

Section 2: Inheritance

Section 2 -- Inheritance.ipynb
32 Inheritance review
33 Using super
34 Three kinds of inheritance
Preview
35 Exercises 5
exercises-5.txt
36 Exercise 5 solutions
37 MRO
38 Multiple inheritance
39 __bases__
40 Mixins
41 Name mangling
42 Exercises 6
exercises-6.txt
43 Exercise solutions
44 Abstract base classes, part 1
45 Abstract base classes, part 2
46 Python's object hierarchy

Section 3: Context managers

Section 3 -- Context managers.ipynb
47 Intro to context managers
48 How context managers work
49 A simple context manager
50 TempStdout
51 Deterministic random numbers
52 Multiple context managers
53 contextlib
54 Exercises 7
exercises-7.txt
55 Exercise solutions 7

Section 4: Properties and descriptors

Section 4 -- Properties and descriptors.ipynb
56 Intro to properties
57 Thermostat
58 Property getters
59 Property setters
60 Excercises 8
61 Excercise 8 solutions
62 Intro to descriptors
63 Instance-specific descriptor values
64 Weak refs and descriptors
65 Descriptors, functions, and methods
66 Exercises 9
exercises-9.txt
67 Exercise solutions 9

Section 5: Advanced topics

Section 5 -- Advanced topics.ipynb
68 Intro to advanced topics
69 Defining __new__
70 Using __new__
71 Creating classes with type
72 Metaclasses
73 Exercises 10
exercises-10.txt
74 Exercise solutions 10
75 Conclusion