Yes, this was necessary to be able to hand non-files to pycurl (like StringIOs). File-like objects are still not file objects in C, so it's easier to just pass a function.