我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用future.utils.isint()。
def __rmul__(self, other): value = super(newint, self).__rmul__(other) if isint(value): return newint(value) elif value is NotImplemented: return other * long(self) return value
def __lshift__(self, other): if not isint(other): raise TypeError( "unsupported operand type(s) for <<: '%s' and '%s'" % (type(self).__name__, type(other).__name__)) return newint(super(newint, self).__lshift__(other))
def __mul__(self, other): value = super(newint, self).__mul__(other) if isint(value): return newint(value) elif value is NotImplemented: return long(self) * other return value
def __rshift__(self, other): if not isint(other): raise TypeError( "unsupported operand type(s) for >>: '%s' and '%s'" % (type(self).__name__, type(other).__name__)) return newint(super(newint, self).__rshift__(other))
def __or__(self, other): if not isint(other): raise TypeError( "unsupported operand type(s) for |: '%s' and '%s'" % (type(self).__name__, type(other).__name__)) return newint(super(newint, self).__or__(other))
def __xor__(self, other): if not isint(other): raise TypeError( "unsupported operand type(s) for ^: '%s' and '%s'" % (type(self).__name__, type(other).__name__)) return newint(super(newint, self).__xor__(other))