Skip to main content

Generic

No overview available.

Methods


Insert()

@classmethod
def Insert(
items: [SetObject](setobject.md?sid=flytestdlib_sets_setobject)
)

Inserts one or more items into the set. This method modifies the set by adding the specified items.

Parameters

NameTypeDescription
items[SetObject](setobject.md?sid=flytestdlib_sets_setobject)The item or items to be added to the set.

Delete()

@classmethod
def Delete(
items: [SetObject](setobject.md?sid=flytestdlib_sets_setobject)
)

Deletes one or more items from the set. This method modifies the set by removing the specified items.

Parameters

NameTypeDescription
items[SetObject](setobject.md?sid=flytestdlib_sets_setobject)The item or items to be removed from the set.

Has()

@classmethod
def Has(
item: [SetObject](setobject.md?sid=flytestdlib_sets_setobject)
) - > bool

Checks if a specific item is present in the set. Callers use this to determine membership of an item.

Parameters

NameTypeDescription
item[SetObject](setobject.md?sid=flytestdlib_sets_setobject)The item to check for existence within the set.

Returns

TypeDescription
boolTrue if the item is found in the set, False otherwise.

HasAll()

@classmethod
def HasAll(
items: [SetObject](setobject.md?sid=flytestdlib_sets_setobject)
) - > bool

Checks if all specified items are present in the set. Callers use this to verify if a collection of items are all members of the set.

Parameters

NameTypeDescription
items[SetObject](setobject.md?sid=flytestdlib_sets_setobject)The collection of items to check for existence within the set.

Returns

TypeDescription
boolTrue if all items are found in the set, False otherwise.

HasAny()

@classmethod
def HasAny(
items: [SetObject](setobject.md?sid=flytestdlib_sets_setobject)
) - > bool

Checks if at least one of the specified items is present in the set. Callers use this to determine if there is any overlap between the set and a collection of items.

Parameters

NameTypeDescription
items[SetObject](setobject.md?sid=flytestdlib_sets_setobject)The collection of items to check for any existence within the set.

Returns

TypeDescription
boolTrue if at least one item is found in the set, False otherwise.

Difference()

@classmethod
def Difference(
g2: [Generic](generic.md?sid=flytestdlib_sets_generic)
) - > [Generic](generic.md?sid=flytestdlib_sets_generic)

Computes the set difference between this set and another Generic set. This method returns a new set containing elements present in this set but not in the other set.

Parameters

NameTypeDescription
g2[Generic](generic.md?sid=flytestdlib_sets_generic)The other Generic set to compare against.

Returns

TypeDescription
[Generic](generic.md?sid=flytestdlib_sets_generic)A new Generic set containing elements from this set that are not in 'g2'.

Union()

@classmethod
def Union(
s2: [Generic](generic.md?sid=flytestdlib_sets_generic)
) - > [Generic](generic.md?sid=flytestdlib_sets_generic)

Computes the set union of this set and another Generic set. This method returns a new set containing all unique elements from both sets.

Parameters

NameTypeDescription
s2[Generic](generic.md?sid=flytestdlib_sets_generic)The other Generic set to combine with.

Returns

TypeDescription
[Generic](generic.md?sid=flytestdlib_sets_generic)A new Generic set containing all unique elements from both this set and 's2'.

Intersection()

@classmethod
def Intersection(
s2: [Generic](generic.md?sid=flytestdlib_sets_generic)
) - > [Generic](generic.md?sid=flytestdlib_sets_generic)

Computes the set intersection of this set and another Generic set. This method returns a new set containing only the common elements found in both sets.

Parameters

NameTypeDescription
s2[Generic](generic.md?sid=flytestdlib_sets_generic)The other Generic set to find common elements with.

Returns

TypeDescription
[Generic](generic.md?sid=flytestdlib_sets_generic)A new Generic set containing elements that are present in both this set and 's2'.

IsSuperset()

@classmethod
def IsSuperset(
s2: [Generic](generic.md?sid=flytestdlib_sets_generic)
) - > bool

Checks if this set is a superset of another Generic set. Callers use this to determine if this set contains all elements of 's2'.

Parameters

NameTypeDescription
s2[Generic](generic.md?sid=flytestdlib_sets_generic)The other Generic set to check against for superset relationship.

Returns

TypeDescription
boolTrue if this set contains all elements of 's2', False otherwise.

Equal()

@classmethod
def Equal(
s2: [Generic](generic.md?sid=flytestdlib_sets_generic)
) - > bool

Compares this set with another Generic set for equality. Callers use this to determine if two sets contain the exact same elements.

Parameters

NameTypeDescription
s2[Generic](generic.md?sid=flytestdlib_sets_generic)The other Generic set to compare for equality.

Returns

TypeDescription
boolTrue if both sets contain the same elements, False otherwise.

ListKeys()

@classmethod
def ListKeys() - > []string

Retrieves a sorted list of keys (string representations) of all items in the set. Callers use this to get an ordered view of the set's contents.

Returns

TypeDescription
[]stringA sorted list of string keys representing the items in the set.

List()

@classmethod
def List() - > [][SetObject](setobject.md?sid=flytestdlib_sets_setobject)

Retrieves a sorted list of all items (SetObject) in the set. Callers use this to get an ordered collection of the actual set objects.

Returns

TypeDescription
[][SetObject](setobject.md?sid=flytestdlib_sets_setobject)A sorted list of SetObject instances contained within the set.

UnsortedListKeys()

@classmethod
def UnsortedListKeys() - > []string

Retrieves an unsorted list of keys (string representations) of all items in the set. Callers use this when the order of keys is not important.

Returns

TypeDescription
[]stringAn unsorted list of string keys representing the items in the set.

UnsortedList()

@classmethod
def UnsortedList() - > [][SetObject](setobject.md?sid=flytestdlib_sets_setobject)

Retrieves an unsorted list of all items (SetObject) in the set. Callers use this when the order of items is not important.

Returns

TypeDescription
[][SetObject](setobject.md?sid=flytestdlib_sets_setobject)An unsorted list of SetObject instances contained within the set.

PopAny()

@classmethod
def PopAny() - > ([SetObject](setobject.md?sid=flytestdlib_sets_setobject), bool)

Removes and returns an arbitrary item from the set. Callers use this to process items from the set one by one, consuming the set.

Returns

TypeDescription
([SetObject](setobject.md?sid=flytestdlib_sets_setobject), bool)A tuple containing the removed SetObject and a boolean indicating if an item was successfully popped (True) or if the set was empty (False).

Len()

@classmethod
def Len() - > int

Returns the number of items currently in the set. Callers use this to determine the size of the set.

Returns

TypeDescription
intThe integer count of items in the set.