In this chapter we will explore the idea of an implicit contract between an object and the code that uses that object. As part of this discussion we will explore what is meant by Duck Typing. Following this we will introduce the Python concept called a protocol. We will explore its role within Python programming and look at two commonly occurring protocols; the Context Manager Protocol and the Descriptor Protocol.
CITATION STYLE
Hunt, J. (2019). Protocols, Polymorphism and Descriptors (pp. 311–323). https://doi.org/10.1007/978-3-030-20290-3_27
Mendeley helps you to discover research relevant for your work.