diff options
author | Charles-François Natali <cf.natali@gmail.com> | 2013-11-29 17:57:47 (GMT) |
---|---|---|
committer | Charles-François Natali <cf.natali@gmail.com> | 2013-11-29 17:57:47 (GMT) |
commit | a951f3d1acb4e12236eb78a1961143ea689d51e6 (patch) | |
tree | 688986108d91cf4fcf1e38473e9f6f9a3b1c4e59 /Doc/library/selectors.rst | |
parent | a9f90bc602c277bd487ff41f308bf7e88b3efb90 (diff) | |
download | cpython-a951f3d1acb4e12236eb78a1961143ea689d51e6.zip cpython-a951f3d1acb4e12236eb78a1961143ea689d51e6.tar.gz cpython-a951f3d1acb4e12236eb78a1961143ea689d51e6.tar.bz2 |
Remove trailing blanks.
Diffstat (limited to 'Doc/library/selectors.rst')
-rw-r--r-- | Doc/library/selectors.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Doc/library/selectors.rst b/Doc/library/selectors.rst index 5acd0c2..a6df909 100644 --- a/Doc/library/selectors.rst +++ b/Doc/library/selectors.rst @@ -214,29 +214,29 @@ Examples of selector usage:: >>> import selectors >>> import socket - >>> + >>> >>> s = selectors.DefaultSelector() >>> r, w = socket.socketpair() - >>> + >>> >>> r.setblocking(False) >>> w.setblocking(False) - >>> + >>> >>> s.register(r, selectors.EVENT_READ) SelectorKey(fileobj=<socket.socket fd=4, family=AddressFamily.AF_UNIX, type=2049, proto=0>, fd=4, events=1, data=None) >>> s.register(w, selectors.EVENT_WRITE) SelectorKey(fileobj=<socket.socket fd=5, family=AddressFamily.AF_UNIX, type=2049, proto=0>, fd=5, events=2, data=None) - >>> + >>> >>> print(s.select()) [(SelectorKey(fileobj=<socket.socket fd=5, family=AddressFamily.AF_UNIX, type=2049, proto=0>, fd=5, events=2, data=None), 2)] - >>> + >>> >>> for key, events in s.select(): ... if events & selectors.EVENT_WRITE: ... key.fileobj.send(b'spam') - ... + ... 4 >>> for key, events in s.select(): ... if events & selectors.EVENT_READ: ... print(key.fileobj.recv(1024)) - ... + ... b'spam' >>> s.close() |