Charles-François Natali added the comment:

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?

----------
keywords: +needs review
Added file: http://bugs.python.org/file31116/selector-9.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16853>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to