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 christian.heimes, felipecruz, giampaolo.rodola, gvanrossum, meador.inge, neologix, pitrou, rosslagerwall, sbt
Date 2013-08-02.15:16:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375456613.31.0.987002581332.issue16853@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2013-08-02 15:16:54neologixsetrecipients: + neologix, gvanrossum, pitrou, giampaolo.rodola, christian.heimes, meador.inge, rosslagerwall, sbt, felipecruz
2013-08-02 15:16:53neologixsetmessageid: <1375456613.31.0.987002581332.issue16853@psf.upfronthosting.co.za>
2013-08-02 15:16:53neologixlinkissue16853 messages
2013-08-02 15:16:53neologixcreate