is_exec = lambda x: subprocess.call("type " + x, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0 and (os.path.isfile(x) and os.access(x, os.X_OK))
I came across this code and it works fine but is it redundant?
Isnt is_exec = lambda x: os.access(x, os.X_OK) sufficient?
Question: Is there a case where is_exec = lambda x: os.access(x, os.X_OK) isnt catching but the first one does?
x.