New submission from Mital Ashok <mital.v...@googlemail.com>:

There's no reason that `count('', 'a')` for `'', 'a', 'aa', ...` or `count((), 
(1,))` for `(), (1,), (1, 1), ...` shouldn't work.

count(a, b) should be equivalent to accumulate(chain((a,), repeat(b)))

The docs don't strongly suggest that it won't work (it says *start* is a 
number, but the "roughly equivalent to" generator would work for str/tuple/etc)

----------
components: Library (Lib)
messages: 412095
nosy: Mital Ashok
priority: normal
severity: normal
status: open
title: itertools.count should work with non-number types
type: enhancement
versions: Python 3.11

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

Reply via email to