Supposing I have a function with a signature like:
def foo(self, name:str, stream):
pass
I want to add an annotation to the "stream" argument so which means "you can have any object x as long as x.readline()->str.
So that means I could use any python file object as an argument here (since it has a readline method), but I could also provide an object which implements nothing but readline and it would be perfectly acceptable.
How could I rewrite this function definition so that I can annotate the 2nd argument?