So you want to be a Python expert?
summary
Live demos on Python 3.6 implement concrete behaviors: add a class with __init__, __repr__, __add__, __len__ and it prints and adds as expected; disassemble and monkeypatch __build_class__ to intercept class creation; enforce subclass contracts with a metaclass and with __init_subclass__; write and apply a timer decorator and an n-times decorator; convert long computations to generators and use contextlib.contextmanager to wrap a generator as a context manager (SQLite temp table example) — everything runs in the demo.
AI-written summary · about
chapters (32)
- 0:00About PyData and being proficient in Python
- 4:09Important features of Python and audience survey
- 7:40Data model methods
- 10:14__init__ method
- 11:15__repr__ method
- 12:17__add__ method
- 15:51__len__ method
- 18:42__call__ method
- 20:50Metaclasses and the problem of writing safe library code
- 27:00Contraints on the library code using assert
- 32:33Compile-time vs run time executable code
- 34:42Disassembling class code and using __build_class__
- 40:26Constraining library code with the metaclass pattern
- 47:22Introducing decorators
- 49:07Code inspection
- 57:36Writing a timer function
- 59:42Decorator syntactic sugar
- 1:03:00Writing a ntimes decorator
- 1:06:32Wrapping functions into class
- 1:10:51Eager execution
- 1:14:02__iter__ and __next__ methods
- 1:17:40yield and the Generator syntax
- 1:20:35Coroutines and interleaving
- 1:24:35Context Managers
- 1:25:30Setup and teardown of resources
- 1:28:38Applying to SQL transactions
- 1:30:10__enter__ and __exit__ methods
- 1:32:30Links between generators and context managers
- 1:36:02Refactoring the SQL query code
- 1:37:52Wrapping up
- 1:40:04Opinions on writing clear code in Python
- 1:48:18Q&A
related talks
19mObjects and classes in Python (and JavaScript)
25mThe Magic of Python
25mAdvanced Python
31mIntroduce Syntax and History of Python from 2.4 to 3.6
46mOn Being Pythonic
47mA Deep-Dive Into Python Classes
01h 18mPython 103: Mmmm... Understanding Python's Memory Model, Mutability, and Methods
33mMetaprogramming in Python
