On Mon, Dec 19, 2011 at 12:24 PM, Nathan Rice email@example.com wrote:
Yes, I love that feature of strings, it is a source of lots of bugs, but I digress. The reason this partially solves that problem is that instead of having to do a bunch of guesswork on an iterable to see if you should do the vectorized version of the function, you just check to see if it is an instance of a certain TypedCollectionContract. If so, vectorize. No "isinstance(foo, Iterable) and not isinstance(foo, basestr)" silliness here.
If you plan to introduce a new ABC to drive this, then I have a simple proposal:
1. Write a module that implements your "broadcast API for collections" 2. Publish it on PyPI 3. When it has popular uptake to indicate widespread user demand, then come back to us