def _is_python_file(filename):
 for ext in ('.py', '.so', '.pyd', '.pyw'):
  if filename.endswith(ext):
   return True
 return False

def _is_python_file ( filename ) : for ext in ( '.py' , '.so' , '.pyd' , '.pyw' ) : if filename . endswith ( ext ) : return True return False
return true if the given filename should be considered as a python file .