This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cheryl.sabella
Recipients anthony-flury, cheryl.sabella, docs@python, rhettinger
Date 2018-02-06.02:21:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517883669.82.0.467229070634.issue32770@psf.upfronthosting.co.za>
In-reply-to
Content
You know, I'm not sure if I had ever seen that example before.  When you click Counter at the top of the page, it goes right to the class definition, which is past the example.

Having said that, I really like the example.  Until now, I didn't realize what Raymond said above about Counters (that the core ability is to write c['x'] += 1 without a KeyError).  So, thanks to this report, I learned that today!

One thing that did surprise me in the example is that I expected the repr to be in insertion order in 3.7.  The class description says 'It is an unordered collection where elements are stored as dictionary keys' and I was wondering if that was still true since dicts now have a guaranteed order.  I tried it on the example, which still printed Counter({'blue': 3, 'red': 2, 'green': 1})!  Of course it makes sense after looking at the code because it calls `most_common` in the repr, but I hadn't realized that before.  So, two things learned about Counter today.   :-)

Anyway, writing this here to ask about the wording regarding 'unordered collection'.

Thanks!
History
Date User Action Args
2018-02-06 02:21:09cheryl.sabellasetrecipients: + cheryl.sabella, rhettinger, docs@python, anthony-flury
2018-02-06 02:21:09cheryl.sabellasetmessageid: <1517883669.82.0.467229070634.issue32770@psf.upfronthosting.co.za>
2018-02-06 02:21:09cheryl.sabellalinkissue32770 messages
2018-02-06 02:21:08cheryl.sabellacreate