def METHOD_NAME(
        fn: tp.Callable[['Bit', 'Bit'], 'Bit']
) -> tp.Callable[['Bit', tp.Union['Bit', bool]], 'Bit']:
    @magma_helper_function
    @functools.wraps(fn)
    def wrapped(self: 'Bit', other: tp.Union['Bit', bool]) -> 'Bit':
        if isinstance(other, Bit):
            return fn(self, other)
        try:
            other = Bit(other)
        except TypeError:
            return NotImplemented
        return fn(self, other)
    return wrapped