def p_side(self, idx, sidedness):
        """Acceptable values for *sidedness* are "auto", "pos",
        "neg", and "two"."""
        dsideval = _dside_names.get(sidedness)
        if dsideval is None:
            raise ValueError('unrecognized sidedness "%s"' % sidedness)

        p = self._pinfob
        p[idx] = (p[idx] & ~PI_M_SIDE) | dsideval
        return self