Clone wiki

sendtools / Home

Sendtool Thoughts and Ideas

Open Design Issues

Use of capitalised type-names might be contentious. My reasoning is that I want to keep things like All, Max, Min, Any etc. distinct from their built-in conterparts. In real-world use-cases, it is quite likely that both itertools functions will be used together with sendtools ones, so keeping the names distinct seems a good plan. Using a prefix ('c' say, for Consumer -> cmax, cmin, call, cany) feels clunky and add to the char-length of `send` function calls when to combine a load of consumers. My plan-B option would be to use all lower-case without any prefix (name-clash be damned). In this case, users should prefix with the module name i.e.

import sendtools as st

st.send(data, (st.min(), st.group_by_key(...etc...)))

A Problem

Here's a use-case which the current design doesn't support (at least not in a sufficiently simply manner). Let's say you want to scan through words in a large document and pull out sub-sections start with one word (or phrase) and ending with another. This feels like GroupByKey or DropWhile/TakeWhile should be the obvious solutions. Using GroupByKey you could split up the input stream at the boundaries of the subsection. The problem is how to signal to the target which sections to keep. I need to think about this...

New Module Objects

1. TakeWhile, DropWhile - Could add these, but it would be for a theoretical completeness. In practice, these are not widely used.

2. A decorator to simplify implementing new Consumers by writing a generator

3. A consumer ABC. Similarly, an aggregate ABC.