Home | Trees | Indices | Help |
|
---|
|
Some fundamental algorithms not found in the standard library.
Classes | |
IndexedGraph is a graph that is indexed by both incoming and outgoing edges. |
|
DeferringDict is a dictionary that stores tuples of a callable and its arguments and will, on the first access, do the calls. |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
Variables | |
__package__ =
|
Function Details |
returns a list with the nodes in the graph edges sorted topologically. edges is a sequence of (from, to)-tuples, where both from and to must be hashable. A ValueError is raised if the graph is not acyclic. |
returns items in a chunked form. getChunkKey(item)->chunk key is a function returning the chunk title, getKeyKey(chunk)->sort key a function returning a sort key for the chunks (default is just the chunk key, i.e., chunk[0] The chunked form is a sequence of pairs of a chunk key and a sequence of items belonging to that chunk. The internal order within each chunk is not disturbed, so you should sort items as desired before passing things in. This is supposed to work like this: >>> chunk(["abakus", "Analysis", "knopf", "Kasper", "kohl"], ... lambda item: item[0].lower()) [('a', ['abakus', 'Analysis']), ('k', ['knopf', 'Kasper', 'kohl'])] |
returns a list of the uniqe items in seq as they appear in seq. Execept for order and return type, this is essentially like set(seq). |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu May 2 07:29:09 2019 | http://epydoc.sourceforge.net |