[issue35117] set.discard should return True or False based on if element existed.

tzickel report at bugs.python.org
Tue Oct 30 14:50:32 EDT 2018


New submission from tzickel <icebreak at yahoo.com>:

Sometimes you want to do something based on if the item existed before removal, so instead of checking if it exists, then removing and doing something, if would be nice to make the function return True or False based on if the element existed.

----------
components: Interpreter Core
messages: 328938
nosy: tzickel
priority: normal
severity: normal
status: open
title: set.discard should return True or False based on if element existed.
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35117>
_______________________________________


More information about the Python-bugs-list mailing list