From f46701623f86c336c30466bf5a5c7eca3f79d20d Mon Sep 17 00:00:00 2001 From: Julian Henry Date: Thu, 20 Apr 2023 07:01:59 -0500 Subject: [PATCH] Update buggy_script_2.py @biobootloader, now fails due to singleton modification of attributes --- examples/buggy_script_2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/buggy_script_2.py b/examples/buggy_script_2.py index 6891bf6..d36cff5 100644 --- a/examples/buggy_script_2.py +++ b/examples/buggy_script_2.py @@ -20,7 +20,9 @@ def return_2(): new_singleton = SingletonClass() singleton.a = 1 new_singleton.a = 2 - return singleton.a + singleton.a + would_be_2 = (singleton.a + singleton.a) + assert would_be_2 == 2 + return would_be_2 if __name__=="__main__": - fire.Fire() \ No newline at end of file + fire.Fire()