negmas.generics Module

A set of generic classes and corresponding functions to iterate and index them.

The main goal of having this module is to allow for flexible modeling of collections with most python builtin collections (e.g. list, tuple, generator) or even Callables without awkward isinstance calls in other modules of the library.

Functions

gmap(group, param)

Calls or indexes the group by the param

gget(x, _key[, default])

Get an item from an IterableMapping

ienumerate(x)

Enumerates a GenericMapping.

iitems(x)

Enumerates a GenericMapping.

ivalues(x)

Returns all keys of the iterable.

ikeys(x)

Returns all keys of the iterable.

iget(x, _key[, default])

Get an item from an IterableMapping