Skip to content
Success

Changes

Summary

  1. trx_toolkit/*: Don't use `del x; x = None` idiom (details)
Commit abef75091d737c99003f5ebe9a1c5dbaa6e2dc7b by Kirill Smelkov
trx_toolkit/*: Don't use `del x; x = None` idiom

In Python it is enough to do `x = None` to release the object that was
pointed to by x previously. So at Python level doing this extra
del only spends more CPU time, but when we will switch to Cython, and
e.g. Msg.burst will be a C-level attribute, the following will not work
at all

del msg.burst
msg.burst = None

because at runtime it will complain that

        del msg.burst
    AttributeError: 'Msg' object has no attribute 'burst' and no __dict__ for setting new attributes

-> Remove unneeded del to save some time and avoid problems with upcoming switch to Cython.

Change-Id: I7a83bdd52fb9318bd8b975f85ce37c7144873f61
The file was modifiedsrc/target/trx_toolkit/burst_fwd.py
The file was modifiedsrc/target/trx_toolkit/fake_trx.py
The file was modifiedsrc/target/trx_toolkit/clck_gen.py