New submission from Nick Coghlan:

As per the python-ideas thread at 
https://mail.python.org/pipermail/python-ideas/2014-February/025226.html the 
statistics.mode() function currently passes its argument directly to the 
collections.Counter() constructor. This results in Counter() objects being 
special-cased rather than treated as ordinary iterables.

For the main API, it seems more appropriate to force treatment as an iterable 
by calling iter() on the argument before passing it to the Counter() 
constructor.

I'll file a separate RFE about making it easier and more efficient to use the 
statistics module with weight/frequency mappings.

----------
components: Library (Lib)
messages: 209930
nosy: gregory.p.smith, larry, ncoghlan, oscarbenjamin, stevenjd, wolma
priority: release blocker
severity: normal
stage: test needed
status: open
title: Avoid inadvertently special casing Counter in statistics module
type: behavior
versions: Python 3.4

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

Reply via email to