This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: list.count() patch for feature request 1370948
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum, m_fondo, rhettinger
Priority: normal Keywords: patch

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:14adminsetgithub: 42699
2005-12-16 01:57:27m_fondocreate