def fileno(f):
    'Get fileno from file-like object.'
    if isinstance(f, numbers.Integral):
        return f
    return f.fileno()
Get fileno from file-like object.
def fileno(f):
    
    if isinstance(f, numbers.Integral):
        return f
    return f.fileno()