Skip to content

← programming package

ListUnique

Reduce list to its unique items.

This will preserve the order of appearance. One may optionally specify a key extraction function that will be used to determine uniqueness. Version 1.0.0

Ports/Properties

lst

Data to process.

  • verbose name: Lst
  • default value: None
  • port type: DataPort
  • value type: list (can be None)
  • data direction: INOUT

key

Key extraction function.

  • verbose name: Key
  • default value: None
  • port type: GraphPort
  • value type: Graph

key__signature

Optional name of a placeholder that will receive the list element from which to extract the unique key. You can define a key extraction function by creating a graph that starts with a Placeholder node whose slotname must be set to the same name as listed here (e.g., "item"), followed by some computation (e.g., a use of GetNested), and whose final node returns the sort key. That final node is then wired into the "key" input port of ListSort). In graphical UIs this edge will show as dotted to indicate that this is not normal forward data flow but a subgraph (i.e., the key function) is being passed to the List Sort node. The key extraction function is called for each element in the list, and the result of the function is used so that only elements with unique keys are retained. This graph should only involve stateless nodes.

  • verbose name: Key [Optional Unique Key Argument]
  • default value: (item)
  • port type: Port
  • value type: object (can be None)

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)