On Mar 20, 3:21 am, Esmail ebo...@gmail.com wrote:
Hi,
I'm new to writing Python code. This is a simple client I wrote, it
works, but I feel it doesn't look as clean as it could. Can anyone
make suggestions how to streamline this code?
Also, I am using two nested functions, it seems that
Paul Hankin wrote:
I would decouple the speaker and the listener from the client, and
make the client interface more abstract. Simple and descriptive
interfaces can make code dramatically easier to understand.
class ClientListener(Thread):
def __init__(self, client, ...):
...
def
Hi!
On Mar 20, 1:06 am, Terry Reedy tjre...@udel.edu wrote:
What you wrote are two nested classes, not functions.
Ooops .. yes of course .. simple mistake (it was late .. :)
In my opinion,
neither should be nested. Nothing is gained and something is lost.
Neither are used by client;
On Mar 19, 10:21 pm, Esmail ebo...@gmail.com wrote:
Hi,
I'm new to writing Python code. This is a simple client I wrote, it
works, but I feel it doesn't look as clean as it could. Can anyone
make suggestions how to streamline this code?
Also, I am using two nested functions, it seems that
On Mar 20, 2:02 pm, prueba...@latinmail.com wrote:
On Mar 19, 10:21 pm, Esmail ebo...@gmail.com wrote:
Hi,
I'm new to writing Python code. This is a simple client I wrote, it
works, but I feel it doesn't look as clean as it could. Can anyone
make suggestions how to streamline this
Esmail wrote:
In my opinion,
neither should be nested. Nothing is gained and something is lost.
Neither are used by client; indeed both use client.
I nested them because I see them as components of the client which
keeps track of the connection parameters and makes the initial
connection and
To make a closure, the inner function *must* be nested in the outer.
To be an instance method, a function *must* be a class attribute, and
the easier way to indicate that is by nesting.
In this case, the client does *not* use the other two classes, so the
nesting is misleading. I think the
Hi,
I'm new to writing Python code. This is a simple client I wrote, it
works, but I feel it doesn't look as clean as it could. Can anyone
make suggestions how to streamline this code?
Also, I am using two nested functions, it seems that nested functions
aren't used that much in Python - is that
Esmail wrote:
Hi,
I'm new to writing Python code. This is a simple client I wrote, it
works, but I feel it doesn't look as clean as it could. Can anyone
make suggestions how to streamline this code?
Also, I am using two nested functions, it seems that nested functions
aren't used that much in