As I encountered similiar problems as documented in issue #41 running tests and the current implementation is more expensive than it should (there can be many _get_event_names calls) I implemented this one.
still lists are returned and we have to slowly copy them as fast as possible by slicing
IS_DIR is always the second one so we always have the event on first position and the flag on second
preferrable would be to utilize tuples that wouldn't need to be copied because of their immutability or frozensets which are faster for "'EVENT_NAME' in event_name" expressions in case the possible second one in list is searched for...
Coverage decreased (-0.9%) to 84.211% when pulling c912e83efbc9dd50aad263dd382679f79502949e on Elias481:fix-issue-41-guarantee-event_names-order into 288a2b01fd4a726dc68d960f8351630aee788a13 on dsoprea:master.
account for issue https://github.com/dsoprea/PyInotify/issues/41 - but do not change interface
As I encountered similiar problems as documented in issue #41 running tests and the current implementation is more expensive than it should (there can be many _get_event_names calls) I implemented this one.