[Python-ideas] Proposal for extending the collections module - bags / multisets, ordered sets / unique lists

Leonardo Santagada santagada at gmail.com
Sat Jul 18 22:19:16 CEST 2009


On Jul 18, 2009, at 4:07 PM, Michael Lenzen wrote:

> My full proposition includes 2 new classes, 2 new abstract base  
> classes, modifying set and a new `collection` function to abstract  
> away the new multitude of classes.
>
> The collection function is my favorite part, you just pass it  
> parameters about the collection you want (mutable, ordered and/or  
> unique) and it returns the collection that fits without you ever  
> having to figure it out.


I was silent on this because I wanted someone that has a say in this  
stuff to stop it but as you really think this is important I have to  
point out that this function is probably unaceptable, it makes code  
that much harder to read (instead of set or list I have to see each  
parameter and form on my mind what they map to) and also GvR already  
said before that he doesn't like functions that have flags that make  
them do completely different things based on those.

Multiset seems interesting, some of the ABCs you mentioned seems to be  
just over engineering (maybe they just need a better justification)  
but this function in my view is unacceptable.

--
Leonardo Santagada
santagada at gmail.com






More information about the Python-ideas mailing list