I've written a simple permissions system that I need to be rather fast, yet useable by other developers who primarily use Java. Is a bitwise permissions system with properties a good compromise. Any suggested speed improvements would be greatly appreciated.class AppliancePerms(object):    Permissions for the Appliance class.    _cmd_right = 2 ** 0    _rest_right = 2 ** 1    _ssh_right = 2 ** 2    _num_of_rights = 3    _all_rights = _cmd_right + _rest_right + _ssh_right    def __init__(self, perm_digits=None):        # default to all rights        if perm_digits is None:            self._perms = AppliancePerms._all_rights        else:            self._perms = perm_digits    @property    def permissions(self):        # zfill to show the total number of permissions even when left most right isn't True        return bin(self._perms)[2:].zfill(AppliancePerms._num_of_rights)    @permissions.setter    def permissions(self, perm_digits):                Set all permissions at once with a number.        Suggested syntax is AppliancePermOInst.permissions(int('111', 2))                self._perms = perm_digits    @permissions.deleter    def permissions(self):        self._perms = 0    @property    def rest(self):        return self._perms & AppliancePerms._rest_right    @rest.setter    def rest(self, boolean):        if boolean:            self._perms |= AppliancePerms._rest_right        else:            del self.rest    @rest.deleter    def rest(self):        if self._perms & AppliancePerms._rest_right:            self._perms -= AppliancePerms._rest_right    @property    def ssh(self):        return self._perms & AppliancePerms._ssh_right    @ssh.setter    def ssh(self, boolean):        if boolean:            self._perms |= AppliancePerms._ssh_right        else:            del self.ssh    @ssh.deleter    def ssh(self):        if self._perms & AppliancePerms._ssh_right:            self.perms -= AppliancePerms._ssh_right    @property    def cmd(self):        return self._perms & AppliancePerms._cmd_right    @cmd.setter    def cmd(self, boolean):        if boolean:            self._perms |= AppliancePerms._cmd_right        else:            del self.cmd    @cmd.deleter    def cmd(self):        if self._perms & AppliancePerms._cmd_right:            self._perms -= AppliancePerms._cmd_right
Binary permissions system with bitwise operators + properties
python;bitwise