本文整理汇总了Python中quex.engine.misc.interval_handling.NumberSet.intersection方法的典型用法代码示例。如果您正苦于以下问题:Python NumberSet.intersection方法的具体用法?Python NumberSet.intersection怎么用?Python NumberSet.intersection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quex.engine.misc.interval_handling.NumberSet
的用法示例。
在下文中一共展示了NumberSet.intersection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: the_intersection
# 需要导入模块: from quex.engine.misc.interval_handling import NumberSet [as 别名]
# 或者: from quex.engine.misc.interval_handling.NumberSet import intersection [as 别名]
def the_intersection(Comment, A, B):
if B.__class__ == Interval: B = NumberSet(B)
print "#\n#" + Comment
print "# A = " + repr(A)
print "# B = " + repr(B)
result = A.intersection(B)
result.assert_consistency()
print "# intersection(A,B) = " + repr(result)
result = B.intersection(A)
result.assert_consistency()
print "# intersection(B,A) = " + repr(result)