[Python-ideas] Adding "Typed" collections/iterators to Python

Nick Coghlan ncoghlan at gmail.com
Mon Dec 19 05:33:17 CET 2011

On Mon, Dec 19, 2011 at 12:24 PM, Nathan Rice
<nathan.alexander.rice at gmail.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


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list