This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients gvanrossum, neologix, pitrou, vstinner
Date 2013-10-25.17:55:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM0T+50FCYL+bP9KfdunfnkoiCi9bfuOzuy5dD2B-2Bscg@mail.gmail.com>
In-reply-to <1381071669.2488.7.camel@fsol>
Content
> 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__).

Thanks, I think that's a great idea.
I'm attaching a patch updating yours with the following:
- asyncio/test_asyncio update
- selectors' documentation update

IMO, it really offers both a compact, easy to use and performant API.

(Note: the mapping doesn't really have to be recreated upon each
get_map() call and could be kept as a private member, but IMO that's
not a performance issue).
Files
File name Uploaded
selectors_map-1.patch neologix, 2013-10-25.17:55:03
History
Date User Action Args
2013-10-25 17:55:04neologixsetrecipients: + neologix, gvanrossum, pitrou, vstinner
2013-10-25 17:55:04neologixlinkissue19172 messages
2013-10-25 17:55:04neologixcreate