S
Stéphane Ninin
Hello,
Probably a stupid question... but still:
why prints None ?
Thanks for your answers,
Probably a stupid question... but still:
why prints None ?
Thanks for your answers,
At a guess, because it has a __str__() method that doesn't returnStéphane Ninin said:Hello,
Probably a stupid question... but still:
why
prints None ?
Thanks for your answers,
Stéphane Ninin said:prints None ?
it's a tricky one: the dispatcher class has a __repr__ method but no
__str__ method, and it delegates all unknown member accesses to
its socket member:
# cheap inheritance, used to pass all other attribute
# references to the underlying socket object.
def __getattr__(self, attr):
return getattr(self.socket, attr)
and the socket object is None at this point (since the dispatcher hasn't
been initialized). and str(None) is indeed "None".
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.