I use python's epoll but it can't use event.data.ptr like in c++.
Sometimes I will register class A.fd and sometimes I will register class B.fd.
So, when epoll.poll() returned, how can I know whether fd belongs to class A or B?
You can always maintain a separate map from fd to A or B. Then when an event gets triggered, lookup based on fd.
Doesn't look like epoll has a richer interface, even in Python 3+
python,epoll.register(fd, eventmask) only has two parameters, how could I to use event.data_ptr like c++?