有序集合

(类来自 pyomo.common.collections.orderedset)

class pyomo.common.collections.orderedset.OrderedSet(iterable=None)[源代码]

基础类: Mixin, MutableSet

__init__(iterable=None)[source]

方法

__init__([iterable])

add(val)

添加一个元素。

clear()

从该集合中移除所有元素。

discard(val)

移除一个元素。

intersection(other)

isdisjoint(other)

如果两个集合的交集为空,则返回True。

pop()

返回弹出的值。

remove(val)

移除一个元素。

union(other)

update(iterable)

成员文档

add(val)[source]

添加一个元素。

clear()[source]

从该集合中移除所有元素。

discard(val)[source]

移除一个元素。如果不存在,不要引发异常。

isdisjoint(other)

如果两个集合的交集为空,则返回True。

pop()

返回弹出的值。如果为空则引发KeyError。

remove(val)[source]

移除一个元素。如果不是成员,则引发 KeyError。