values is an array; eventTokens is a string (first element of values). What does the double assignment do? (What are the values of eventToken1 & eventToken2?)
values = data.split("\x01")
eventTokens = values.pop(0)
eventToken1, eventToken2 = eventTokens
I've done an output task (on the Python source) that resulted in the following:
eventTokens is →☹
eventToken1 is →
eventToken2 is ☹
I concluded that the vars somehow split the initial string. However, if I tried compiling an (apparently) similar thing:
arr = ["some", "elements", "inarray"]
c = arr.pop(0)
a, b = c
print c
print a
print b
It resulted in an exception: ValueError: too many values to unpack .
Note: print is not a parameterized method in the tested environment