Issue 1382087: list.count() patch for feature request 1370948 (original) (raw)

Created on 2005-12-16 01:57 by m_fondo, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
listobject.patch m_fondo,2005-12-16 01:57 patch for feature request 1370948
Messages (5)
msg49205 - (view) Author: Mike Fondo (m_fondo) Date: 2005-12-16 01:57
With patch, list.count() works like list.index() for start and end parameters
msg49206 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-12-16 03:15
Logged In: YES user_id=80475 Other than consistency is there a reason for the patch? I understand that str.count and list.index both have optional start/stop arguments, but those both have use cases. AFAICT, no real-world use cases have been presented for list.count with start/stop arguments. A quick grep of the standard library does not reveal ANY code that would be improved as a result of this patch. The proposal does have some minor disadvantages: 1) complicating the signature and docs, 2) introducing a inter-version incompatability, 3) slowing the method call (changing from METH_O to METH_ARGS). Unless some offsetting benefits are shown, this patch should probably not be accepted.
msg49207 - (view) Author: Mike Fondo (m_fondo) Date: 2005-12-16 15:04
Logged In: YES user_id=1406113 With those considerations in mind, I can't disagree. Rejecting would be best.
msg49208 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2005-12-16 17:20
Logged In: YES user_id=6380 Right.
msg49209 - (view) Author: Mike Fondo (m_fondo) Date: 2005-12-16 19:29
Logged In: YES user_id=1406113 That was a pretty sappy response, eh? Oh well, I stand by it.
History
Date User Action Args
2022-04-11 14:56:14 admin set github: 42699
2005-12-16 01:57:27 m_fondo create