A little refactoring.

Add read(), write(), and readwrite() helper functions to shorten poll
functions.  Use get() instead of try/except KeyError for lookup.
XXX How could the lookup ever fail?

Remove module-level DEBUG flag.

Use iteritems() instead of items() when walking the socket map.

Reformat the functions I touched so that are consistently Pythonic.
1 file changed