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

Windson Yang report at bugs.python.org
Tue Oct 30 23:52:31 EDT 2018


Windson Yang <wiwindson at gmail.com> added the comment:

I guess we can implement using ref_count? However, I agreed 

"The use of variables that haven't been defined or set (implicitly or explicitly) is almost always a bad thing in any language since it indicates that the logic of the program hasn't been thought through properly, and is likely to result in unpredictable behavior."

from https://stackoverflow.com/questions/843277/how-do-i-check-if-a-variable-exists

----------
nosy: +Windson Yang

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


More information about the Python-bugs-list mailing list