def is_block(fthing):
 if ((fthing is sys.stdout) or (fthing is sys.stdin)):
  return True
 else:
  mode = os.stat(fthing.name).st_mode
  return (S_ISBLK(mode) or S_ISCHR(mode))

def is_block ( fthing ) : if ( ( fthing is sys . stdout ) or ( fthing is sys . stdin ) ) : return True else : mode = os . stat ( fthing . name ) . st_mode return ( S_ISBLK ( mode ) or S_ISCHR ( mode ) )
take in a file object and checks to see if its a block or fifo .