New submission from Ezio Melotti <ezio.melo...@gmail.com>:

The 3rd example of defaultdict [1] shows how to use it to count the
letters of a string, but the new Counter class is a better tool for
doing that.

Possible solutions:
1) "Setting the default_factory to int makes the defaultdict useful for
counting (like a bag or multiset in other languages):" -> "Setting the
default_factory to int makes the defaultdict useful for basic counting
(see also the Counter class for more features):";
2) remove the example.

[1]:
http://docs.python.org/dev/py3k/library/collections.html#defaultdict-examples

----------
assignee: georg.brandl
components: Documentation
messages: 92534
nosy: ezio.melotti, georg.brandl, rhettinger
priority: low
severity: normal
status: open
title: defaultdict example in py3 doc should mention the new Counter class
versions: Python 3.1, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6893>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to