- Expert Python Programming(Third Edition)
- Micha? Jaworski Tarek Ziadé
- 229字
- 2021-06-24 14:55:16
Summary
This chapter covered various best syntax practices that do not directly relate to Python classes and object-oriented programming. We started by dissecting the syntax for basic built-in types as well as the technical details of their implementation in the CPython interpreter.
After organizing our basic knowledge about Python built-in types, we finally discussed concepts that are truly advanced parts of Python programming language: iterators, generators, decorators, and context managers. Of course, we couldn't make this part completely class-less, as everything in Python is an object, and even elements of syntax that are not object-oriented have their underlying language protocols defined at the class-level object anatomy. So, in order to fulfill the title of this chapter, we then moved our focus to another major aspect of Python programming – the features of language that allow us to program in a functional style.
In order to end this chapter with a lighter tone, we've looked at a few lesser known, but still important and useful, features of Python language.
In the next chapter, we will use everything we learned so far to better understand the object-oriented features of Python. We will look more closely at the concept of language protocols and about method resolution order. We will see that, in Python, every paradigm has its place, and we will discover how object-oriented elements of the language allow for its plasticity.