Square Peg in a Round Hole
Hail to Adapters!
Published in
2 min readJun 6, 2022
Suppose we have a Python function that reads data from a file-like object (any object that has a read()
method) — for example, pandas.read_table()
.
Suppose we also have string data that has been already read/extracted from a file or obtained in some other way. We want to apply the function to the data, but the data is a round peg, and the function is a square…