Message201268
> 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). |
|
Date |
User |
Action |
Args |
2013-10-25 17:55:04 | neologix | set | recipients:
+ neologix, gvanrossum, pitrou, vstinner |
2013-10-25 17:55:04 | neologix | link | issue19172 messages |
2013-10-25 17:55:04 | neologix | create | |
|