def pin(self, spec, pin_class=None, **kwargs):
        """
        The pin method for :class:`MockFactory` additionally takes a *pin_class*
        attribute which can be used to override the class' :attr:`pin_class`
        attribute. Any additional keyword arguments will be passed along to the
        pin constructor (useful with things like :class:`MockConnectedPin` which
        expect to be constructed with another pin).
        """
        if pin_class is None:
            pin_class = self.pin_class
        n = self.pi_info.to_gpio(spec)
        try:
            pin = self.pins[n]
        except KeyError:
            pin = pin_class(self, n, **kwargs)
            self.pins[n] = pin
        else:
            # Ensure the pin class expected supports PWM (or not)
            if issubclass(pin_class, MockPWMPin) != isinstance(pin, MockPWMPin):
                raise ValueError('pin %d is already in use as a %s' % (n, pin.__class__.__name__))
        return pin
def pin ( self , spec , pin_class = None , ** kwargs ) : if pin_class is None : pin_class = self . pin_class n = self . pi_info . to_gpio ( spec ) try : pin = self . pins [ n ] except KeyError : pin = pin_class ( self , n , ** kwargs ) self . pins [ n ] = pin else : if issubclass ( pin_class , MockPWMPin ) != isinstance ( pin , MockPWMPin ) : raise ValueError ( 'pin %d is already in use as a %s' % ( n , pin . __class__ . __name__ ) ) return pin
The pin method for :class:`MockFactory` additionally takes a *pin_class*
        attribute which can be used to override the class' :attr:`pin_class`
        attribute. Any additional keyword arguments will be passed along to the
        pin constructor (useful with things like :class:`MockConnectedPin` which
        expect to be constructed with another pin).