Antoine Pitrou added the comment: FWIW, I think the "ideal" solution would be for keys() (*) to return a read-only Mapping implementation, allowing for file object lookup (using __getitem__) as well as iteration on SelectorKeys (using __iter__) and fast emptiness checking (using __len__).
(to implement Mapping, you can subclass Mapping and implement __getitem__, __len__ and __iter__) (*) or a better name ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19172> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com