python: Working on the protocol implementation