本文整理汇总了Python中future.utils.isint方法的典型用法代码示例。如果您正苦于以下问题:Python utils.isint方法的具体用法?Python utils.isint怎么用?Python utils.isint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类future.utils
的用法示例。
在下文中一共展示了utils.isint方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __mul__
# 需要导入模块: from future import utils [as 别名]
# 或者: from future.utils import isint [as 别名]
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
示例2: __rmul__
# 需要导入模块: from future import utils [as 别名]
# 或者: from future.utils import isint [as 别名]
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
示例3: __lshift__
# 需要导入模块: from future import utils [as 别名]
# 或者: from future.utils import isint [as 别名]
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))
示例4: __rshift__
# 需要导入模块: from future import utils [as 别名]
# 或者: from future.utils import isint [as 别名]
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))
示例5: __or__
# 需要导入模块: from future import utils [as 别名]
# 或者: from future.utils import isint [as 别名]
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))
示例6: __xor__
# 需要导入模块: from future import utils [as 别名]
# 或者: from future.utils import isint [as 别名]
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))
示例7: __and__
# 需要导入模块: from future import utils [as 别名]
# 或者: from future.utils import isint [as 别名]
def __and__(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).__and__(other))