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 provided 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 provided 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 exists within 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 in the set.

Returns

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

HasAll()

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

Checks if all specified items exist within 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 in the set.

Returns

TypeDescription
boolTrue if all provided items are present 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 exists within the set. Callers use this to determine if any item from a collection is a member of the set.

Parameters

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

Returns

TypeDescription
boolTrue if at least one of the provided items is present 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. Callers use this to find items present in the current 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 items present in the current set but 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. Callers use this to combine all unique items from both sets into a new set.

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 items from both the current 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. Callers use this to find items common to 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 only the items that are present in both the current 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 the current set contains all elements of another set.

Parameters

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

Returns

TypeDescription
boolTrue if the current 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 in the set. Callers use this to get an ordered collection of the actual SetObject items.

Returns

TypeDescription
[][SetObject](setobject.md?sid=flytestdlib_sets_setobject)A sorted list of SetObject items 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 an ordered list is not required, potentially for performance.

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 in the set. Callers use this when an ordered list of SetObject items is not required, potentially for performance.

Returns

TypeDescription
[][SetObject](setobject.md?sid=flytestdlib_sets_setobject)An unsorted list of SetObject items 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 an arbitrary SetObject from the set 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.