Advanced Python objects by Reuven M. Lerner

Advanced Python objects

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

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.

What's included?

Video Icon 75 videos File Icon 11 files

Contents

01 Welcome
2 mins
Section 1: Advanced methods
02 Intro to magic methods
6 mins
03 Equality with __eq__
9 mins
04 Other comparison operators
5 mins
05 total_ordering
4 mins
06 The "operator" module
3 mins
07 Exercises 1
2 mins
exercises-1.txt
389 Bytes
08 Exercise 1 solutions
9 mins
09 __add__
8 mins
10 reversing things with __radd__
4 mins
11 __iadd__
7 mins
12 Exercises 2
3 mins
exercises-2.txt
643 Bytes
13 Exercise 2 solutions
10 mins
14 __getitem__
7 mins
15 operator.itemgetter
4 mins
16 __contains__
6 mins
17 __int__ and __float__
6 mins
18 __bool__
5 mins
19 __format__
8 mins
20 Exercises 3
4 mins
exercises-3.txt
1.42 KB
21 Exercise 3 solutions
12 mins
22 __del__
11 mins
23 __getattr__
14 mins
24 __getattr__ vs getattr
4 mins
25 __setattr__
7 mins
26 __slots__
7 mins
27 __getattribute__
7 mins
28 Exercises 4
1 min
exercises-4.txt
660 Bytes
29 Exercise solutions 4
8 mins
30 Static methods
7 mins
31 Class methods
6 mins
Section 2: Inheritance
32 Inheritance review
11 mins
33 Using super
7 mins
34 Three kinds of inheritance
8 mins
35 Exercises 5
3 mins
exercises-5.txt
987 Bytes
36 Exercise 5 solutions
9 mins
37 MRO
5 mins
38 Multiple inheritance
12 mins
39 __bases__
4 mins
40 Mixins
10 mins
41 Name mangling
8 mins
42 Exercises 6
3 mins
exercises-6.txt
1.4 KB
43 Exercise solutions
10 mins
44 Abstract base classes, part 1
6 mins
45 Abstract base classes, part 2
11 mins
46 Python's object hierarchy
11 mins
Section 3: Context managers
47 Intro to context managers
7 mins
48 How context managers work
3 mins
49 A simple context manager
10 mins
50 TempStdout
5 mins
51 Deterministic random numbers
5 mins
52 Multiple context managers
3 mins
53 contextlib
6 mins
54 Exercises 7
2 mins
exercises-7.txt
890 Bytes
55 Exercise solutions 7
9 mins
Section 4: Properties and descriptors
Section 4 -- Properties and descriptors.ipynb
56 KB
56 Intro to properties
6 mins
57 Thermostat
6 mins
58 Property getters
5 mins
59 Property setters
4 mins
60 Excercises 8
2 mins
61 Excercise 8 solutions
9 mins
62 Intro to descriptors
12 mins
63 Instance-specific descriptor values
8 mins
64 Weak refs and descriptors
8 mins
65 Descriptors, functions, and methods
9 mins
66 Exercises 9
2 mins
exercises-9.txt
834 Bytes
67 Exercise solutions 9
9 mins
Section 5: Advanced topics
Section 5 -- Advanced topics.ipynb
16.1 KB
68 Intro to advanced topics
2 mins
69 Defining __new__
5 mins
70 Using __new__
7 mins
71 Creating classes with type
6 mins
72 Metaclasses
9 mins
73 Exercises 10
1 min
exercises-10.txt
138 Bytes
74 Exercise solutions 10
4 mins
75 Conclusion
1 min