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: Add an parameter to list.remove()
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.9
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: SilentGhost, lovi
Priority: normal Keywords:

Created on 2019-12-15 12:30 by lovi, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg358420 - (view) Author: Lovi (lovi) Date: 2019-12-15 12:30
I think the list can add a parameter to remove():

remove(value, appear_time=1, /)

The parameter appear_time indicates the number of times the value appears in the list.


I want this effect:

>>> list1 = [1, 2, 3, 2, 1, 2, 1]
>>> list1.remove(2, 2)
>>> list1
[1, 2, 3, 1, 2, 1]
>>> list1.remove(1, 3)
>>> list1
[1, 2, 3, 1, 2]
msg358422 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2019-12-15 12:37
Again, please start proposal discussion at python-ideas. Also, it is not sufficient just to post there, you need to engage with the people asking question to justify whatever new feature you're advocating.
History
Date User Action Args
2022-04-11 14:59:24adminsetgithub: 83235
2019-12-15 12:37:34SilentGhostsetstatus: open -> closed

components: + Interpreter Core
versions: + Python 3.9, - Python 3.8
nosy: + SilentGhost

messages: + msg358422
resolution: not a bug
stage: resolved
2019-12-15 12:30:37lovicreate