cf.set

cf.set(values, units=None)

Return an object for testing whether a variable equals any element of a collection.

Parameters :

values : scalar or tuple or list or set

Returns :
out : Comparison

A Comparison object which will evaluate whether or not the comparison evaluates to True.

Examples

>>> c = cf.set([3, 5])
>>> c
<CF Comparison: set [3, 5]>
>>> 4 == c
False
>>> 5 == c
True
>>> c = cf.set(4)
>>> c
<CF Comparison: set (4,)>
>>> 4 == c
True

Previous topic

cf.ne

Next topic

cf.wi

This Page