Skip to content

← programming package

SetDifference

Calculate the difference of two sets A and B.

That is, the result will have all elements that are in A but not in B. Note that the output will have no duplicates. This node will treat sets, lists, tuples, and arrays as sets, and all other values (incl. strings, bytes, numbers, bools and dicts) as one-element sets containg the value. Note that this will not flatten lists of lists but will instead treat each inner list as a set element. n-dimensional arrays are not permitted and have to be either flattened to a 1d array, or converted into a list of array slices, whichever is desired. If at least one of the two operands was an array, the result is an array, otherwise a list. One may also pass either operand as Python's built-in set type, in which case the result will be a set, unless the result contains set elements that are themselves composite objects (e.g., lists or dicts), in which case the output remains a list. As with all set operations, the order of items in the result is not guaranteed to be the same as in the inputs and may also not be sorted. If sorted outputs are desired, one may use the Sort node on the result. More Info... Version 0.8.0

Ports/Properties

data1

Set 1.

verbose name
Data1
default value
None
port type
DataPort
value type
object (can be None)
data direction
IN

data2

Set 2.

verbose name
Data2
default value
None
port type
DataPort
value type
object (can be None)
data direction
IN

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)

result

Result.

verbose name
Result
default value
None
port type
DataPort
value type
object (can be None)
data direction
OUT