def is_writable_file_like(obj):
 return callable(getattr(obj, u'write', None))

def is_writable_file_like ( obj ) : return callable ( getattr ( obj , u'write' , None ) )
return true if *obj* looks like a file object with a *write* method .