I think it's a pretty common itch! Have you seen the boltons implementation? http://boltons.readthedocs.org/en/latest/fileutils.html#file-permissions

Mahmoud
github.com/mahmoud

On Sat, Jan 9, 2016 at 8:11 AM, Chris Angelico <rosuav@gmail.com> wrote:
On Sun, Jan 10, 2016 at 3:06 AM, Ram Rachum <ram@rachum.com> wrote:
> Thanks for the reference. Personally I think that `my_path.stat().st_mode &
> stat.S_IXGRP` is not human-readable enough. I'll work on a nicer API.
> Probably this for the same action you described:
>
> 'x' in my_path.chmod()['g']
>
>

Okay. I'm not sure how popular that'll be, but sure.

As an alternative API, you could have it return a tuple of permission
strings, which you'd use thus:

'gx' in my_path.mode() # Group eXecute permission is set

But scratch your own itch, and don't give in to the armchair advisers.

ChrisA
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/