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 giampaolo.rodola
Recipients giampaolo.rodola, neologix, vstinner, yselivanov
Date 2017-04-07.18:09:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491588569.64.0.737380369627.issue30014@psf.upfronthosting.co.za>
In-reply-to
Content
In certain protocols modify() is supposed to be used on every interaction between client and server. E.g. an FTP server does this:

- register(fd, EVENT_READ); recv()         # wait command from client
- modify(fd, EVENT_WRITE); send(response)  # send response
- modify(fd, EVENT_READ); recv()           # wait for new command

...so it's two calls for each command received.
In asyncio modify() is also used in different circumstances. 
If you're worried about code duplication I can refactor selectors.py first, but IMO it would be a bad idea to reject this or future improvements because the current code status prevents code reuse. Right now there are already 3 classes sharing basically the same code (poll, epoll and devpoll related classes). Those can be refactored similarly to this:
https://github.com/giampaolo/pyftpdlib/blob/ab699b5f89223e03593f3e004d6a370b4c2e5308/pyftpdlib/ioloop.py#L465-L565
History
Date User Action Args
2017-04-07 18:09:29giampaolo.rodolasetrecipients: + giampaolo.rodola, vstinner, neologix, yselivanov
2017-04-07 18:09:29giampaolo.rodolasetmessageid: <1491588569.64.0.737380369627.issue30014@psf.upfronthosting.co.za>
2017-04-07 18:09:29giampaolo.rodolalinkissue30014 messages
2017-04-07 18:09:29giampaolo.rodolacreate