Type problem on Windows

Thomas Wouters thomas at xs4all.net
Sat Jun 10 15:45:59 EDT 2000


On Sat, Jun 10, 2000 at 06:43:11PM +0000, Jerome Chan wrote:
> In article <02d101bfd318$8091ae10$6401a8c0 at home>, "Darrell Gallion" 
> <darrell at dorb.com> wrote:

> > sockets are platform dependent as expected :)

> Eeek. So maybe I should wrap the socket object in my own class and then 
> test for that class.

No. The best thing to do is (usually) to assume that the object passed in is
indeed a socket, and use it as such. Document that the function takes a
socket *or a socket-like object* as argument, possibly stating which methods
of sockets it is going to use, and let users of the function decide for
themselves wether they *really* want to pass you a socket, or a
makebelieve/wrapper/debug class.

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list