Skip to content

Commit a157bbc

Browse files
author
Kevin J Walters
committed
Changing assignments of None to _ to normal del for clean-up - this was due to misunderstanding from REPL behaviour.
1 parent 81fbdd7 commit a157bbc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

CLUE_Rock_Paper_Scissors/advanced/clue-multi-rpsgame.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,12 @@ def addPlayer(name, addr_text, address, ad):
308308
scan_time=JG_MSG_TIME_S,
309309
scan_response_request=True,
310310
ad_cb=((lambda _a, _b, _c:
311-
rps_display.flashBLE()) if JG_FLASH
311+
rps_display.flashBLE())
312+
if JG_FLASH
312313
else None),
313314
endscan_cb=lambda _a, _b, _c: button_left(),
314315
name_cb=addPlayer)
315-
_ = None # Clear to allow GC
316+
del _ # To clean-up with GC below
316317
sample.stop()
317318
gc.collect()
318319
d_print(2, "GC after JG", gc.mem_free())
@@ -441,8 +442,8 @@ def addPlayer(name, addr_text, address, ad):
441442
receive_n=num_other_players,
442443
seq_tx=seq_tx,
443444
ads_by_addr=key_data_by_addr)
444-
del key_data_by_addr
445-
_ = None # Allow old value of _ to be GC'd, del does not work on _
445+
del key_data_by_addr, _ # To allow GC
446+
446447
# This will have accumulated all the messages for this round
447448
allmsg_by_addr = re_by_addr
448449
del re_by_addr

0 commit comments

Comments
 (0)