[Python-ideas] IntFlags

Serhiy Storchaka storchaka at gmail.com
Sat Mar 7 19:58:33 CET 2015


On 07.03.15 20:21, Neil Girdhar wrote:
> Why do you need ~ at all?  Do any API calls that you want to make want
> the inverted flags?  Isn't the only point of inverting the bits in order
> to clear a field?

Because existing code uses it.

mode = os.stat(path).st_mode
os.chmod(path, mode & ~(stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH))




More information about the Python-ideas mailing list