[issue31717] Socket documentation threading misstep?
New submission from Phillip <phillip@infiniteautomation.com>: Very small, but, https://docs.python.org/2/howto/sockets.html https://docs.python.org/3/howto/sockets.html have : while True: # accept connections from outside (clientsocket, address) = serversocket.accept() # now do something with the clientsocket # in this case, we'll pretend this is a threaded server ct = client_thread(clientsocket) ct.run() and for some reason I really want it to be ct.start() ---------- assignee: docs@python components: Documentation messages: 303831 nosy: apoplexy, docs@python priority: normal severity: normal status: open title: Socket documentation threading misstep? versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue31717> _______________________________________
R. David Murray <rdmurray@bitdance.com> added the comment: Based on the paragraph following the example, I don't think client_thread is a threading.Thread, and 'run' is meant to be a generic representation of a possible API. Since Threads do have a 'run' method, this is certainly potentially confusing. Maybe we should change it to 'start_thread' or something like that? ---------- nosy: +r.david.murray versions: -Python 3.4, Python 3.5, Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue31717> _______________________________________
R. David Murray <rdmurray@bitdance.com> added the comment: Or maybe instead of client_handler/run, it should be something like handle_client_asynchronously(clientsocket). ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue31717> _______________________________________
Phillip <phillip@infiniteautomation.com> added the comment: I could definitely understand that. After all, if it's slightly askew (or strikes some as such) it forces critical thinking, which is good. I didn't think calling run() was indicative of the three likely pathways to handle the client socket in the following paragraph. I'm indifferent, I just saw something so I said something, but ultimately I think you guys do a tremendous job keeping this documentation good. Thanks, On Fri, Oct 6, 2017 at 10:44 AM, R. David Murray <report@bugs.python.org> wrote:
R. David Murray <rdmurray@bitdance.com> added the comment:
Or maybe instead of client_handler/run, it should be something like handle_client_asynchronously(clientsocket).
----------
_______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue31717> _______________________________________
---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue31717> _______________________________________
participants (2)
-
Phillip
-
R. David Murray