New submission from Yang Feng <[email protected]>:
In the following programs, dict is created in recursive calls. Then a core dump
is reported by Python interpreter.
+++++++++++++++++++++++++++++++++++++++++++
def test_equal_operator_modifying_operand():
class X():
def __del__(DictTest):
dict_b.clear()
def __eq__(DictTest, other):
dict_a.clear()
return True
def __hash__(DictTest):
return 13
dict_d = {X(): 0}
class Y():
def __eq__(DictTest, other):
dict_d.clear()
return True
dict_d = {0: Y()}
# dict_c = {0: set()}
test_equal_operator_modifying_operand()
test_equal_operator_modifying_operand()
+++++++++++++++++++++++++++++++++++++++++
----------
components: Interpreter Core
messages: 386765
nosy: CharlesFengY
priority: normal
severity: normal
status: open
title: Dict creation in recursive function cause interpreter crashes.
type: crash
versions: Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43187>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com