Raymond Hettinger added the comment:
The elements() method is working correctly:
>>> from collections import Counter
>>> aCounter = Counter('abracadabra')
>>> list(aCounter.elements())
['a', 'a', 'a', 'a', 'a', 'b', 'b', 'r', 'r', 'c', 'd']
No arguments should be passed into e
Eric V. Smith added the comment:
When reporting a bug, please give a full example that we can run. I assume
aCounter is of type collections.Counter?
Assuming so, the "1 positional argument" is "self". The second argument is the
number 1, which is an error. So the error is correct.
-
New submission from bytebites :
aCounter.elements(1) gives wrong error message:
TypeError: Counter.elements() takes 1 positional argument but 2 were given
--
messages: 402795
nosy: bytebites
priority: normal
severity: normal
status: open
title: Counter.elements() wrong error message
typ