ORIGINAL CODE: Function declaration is: def add(self, float timeout=-1): The complaint is in (line starting with self.tv.tv_usec), which is also the first time timeout is used in the function: if timeout >= 0.0: self.tv.tv_sec = timeout self.tv.tv_usec = (timeout - self.tv.tv_sec) * 1000000.0 event_add(&self.ev, &self.tv) ERROR OUTPUT: /root/pyevent/pyevent-0.3/event2.pyx:156:64: Cannot assign type 'double' to 'unsigned int' I fixed it by changing the complaining line to: self.tv.tv_usec = (timeout - float(self.tv.tv_sec))