ivalues

negmas.generics.ivalues(x: Union[Mapping, Sequence])Iterable[Any][source]

Returns all keys of the iterable.

Parameters

x (IterableMapping) – A generic mapping (see GenericMapping)

Examples

Example with a list

>>> for k in ivalues([10, 20, 30]): print(k, end='-')
10-20-30-

Example with a dictionary

>>> for k in ivalues({'a': 10, 'b': 20, 'c': 30}): print(k, end='-')
10-20-30-

Example with a tuple

>>> for k in ivalues((10, 20, 30)): print(k, end='-')
10-20-30-

Example with a generator

>>> for k in ivalues(range(10, 40, 10)): print(k, end='-')
10-20-30-
Returns

a generator/iterator with tuples of key-value pairs.