Pre-PEP: Dictionary accumulator methods

George Sakkis gsakkis at
Sun Mar 20 00:39:52 CET 2005

> -1 form me.
> I'm not very glad with both of them ( not a naming issue ) because i
> think that the dict type should offer only methods that apply to each
> dict whatever it contains. count() specializes to dict values that are
> addable and appendlist to those that are extendable. Why not
> subtractable, dividable or right-shiftable? Because of majority
> approval? I'm mot a speed fetishist and destroying the clarity of a
> very fundamental data structure for speedup rather arbitrary
> accumulations seems to be a bad idea. I would move this stuff in a
> subclass.
> Regards Kay

+1 on this. The new suggested operations are meaningful for a subset of all valid dicts, so they
should not be part of the base dict API. If any version of this is approved, it will clearly be an
application of the "practicality beats purity" zen rule, and the justification for applying it in
this case instead of subclassing should better be pretty strong; so far I'm not convinced though.


More information about the Python-list mailing list