Message194179
Here's a patch, based on the version in tulip's repo.
I've added doc update and tests.
I also made the following changes:
- BaseSelector is an abstract base class (so one could imagine user code implementing its own selector on top of it)
- SelectorKey is a named tuple: I think that's better than a class, because SelectorKeys can be returned to the user (register(), get_info(), etc), and we don't want him to mess with them. Also, we get a nice repr() for free
- since SelectorKey is immutable, I added a get_keys() method, which returns all the keys registered. Since it's a dict values, the user can't mess with it
This get_keys() method superseedes the registered_count() method, which can be simply replaced with len(selector.get_keys()). We could probably remove it? It also sort of superseedes the get_info() method: I don't remember, why was it needed?
Would it be possible to get it into 3.4? |
|
Date |
User |
Action |
Args |
2013-08-02 15:16:54 | neologix | set | recipients:
+ neologix, gvanrossum, pitrou, giampaolo.rodola, christian.heimes, meador.inge, rosslagerwall, sbt, felipecruz |
2013-08-02 15:16:53 | neologix | set | messageid: <1375456613.31.0.987002581332.issue16853@psf.upfronthosting.co.za> |
2013-08-02 15:16:53 | neologix | link | issue16853 messages |
2013-08-02 15:16:53 | neologix | create | |
|