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

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Jul 19 04:15:20 CEST 2009


Mathias Panzenböck wrote:

> I always thought it's odd that pythons list has append but
> the set class has the method add. Whats the reason for that anyway?

In English, "append" means "add at the end", which doesn't
make sense for an unordered collection.

On the other hand, "add" doesn't imply anything about
ordering, so using it for lists would make the intent
less clear.

-- 
Greg




More information about the Python-ideas mailing list