[issue11051] system calls per import

Terry J. Reedy report at bugs.python.org
Wed Dec 7 23:20:28 CET 2011


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I am a little puzzled by the patch. In logic, 'A and B' is equivalent to 'not A or not B'. But in the patch,

-            if (_Py_stat(filename, &statbuf) == 0 &&  /it exists */
-                S_ISDIR(statbuf.st_mode)) /* it's a directory */
+            if (_Py_stat(filename, &statbuf) != 0 || S_ISDIR(statbuf.st_mode))

you seem to change to 'not A or B', without negating B. Is this intentional? What am I missing? Some subtle effect of lazy evaluation? Or an intentional change in the logic?

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11051>
_______________________________________


More information about the Python-bugs-list mailing list