[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 78d0b7472697 by Nick Coghlan in branch 'default':
Issue #20478: avoid special casing Counter in statistics
http://hg.python.org/cpython/rev/78d0b7472697

--
nosy: +python-dev

___
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



[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Committed on your behalf Steven, since I'm still not sure if your SSH key has 
been registered yet.

--
resolution:  - fixed
stage: test needed - committed/rejected
status: open - closed

___
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



[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-07 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Fix as suggested by Nick, and new test.

--
keywords: +patch
Added file: http://bugs.python.org/file33983/counter.patch

___
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



[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-02 Thread Steven D'Aprano

Changes by Steven D'Aprano steve+pyt...@pearwood.info:


--
assignee:  - stevenjd

___
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



[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-01 Thread Nick Coghlan

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



[issue20478] Avoid inadvertently special casing Counter in statistics module

2014-02-01 Thread Nick Coghlan

Nick Coghlan added the comment:

Issue 20479 covers providing tools for efficiently working with 
weight/frequency mappings in 3.5 (and presumably the statslib PyPI module)

--

___
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