February 2018
Beginner to intermediate
364 pages
10h 32m
English
This write could have simply been handled using a function that wraps the code. This object will be reused throughout this chapter. We could use the duck-typing of python, or just a function, but the clarity of interfaces is easier. Speaking of that, the following is the definition of this interface:
""" Defines the interface for writing a blob of data to storage """from interface import Interfaceclass IBlobWriter(Interface): def write(self, filename, contents): pass
We will also see another implementation of this interface that lets us store files in S3. Through this type of implementation, through interface inheritance, we can easily substitute implementations.
Read now
Unlock full access