Skip to content

python/cscp: fix empty dict as payload is not sent

Stephan Lachnit requested to merge p-python-send-empty-dict into main

Currently, Python checks if there is a payload with if payload. However, this is not the correct behavior in all cases. For example, I might want to send an empty dictionary for initialization, but:

payload = {}
if not payload:
    print("no payload!")

reveals says the wouldn't be a payload. So the correct statement is checking if the object is None.

Merge request reports