]> granicus.if.org Git - python/commit
Made SocketType and socket the same thing: a subclassable type whose
authorGuido van Rossum <guido@python.org>
Sat, 27 Oct 2001 22:20:47 +0000 (22:20 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 27 Oct 2001 22:20:47 +0000 (22:20 +0000)
commit384ca9c6dd4906c825e126218895f20b8f686372
treeaa457bd5389815ff292975438c751aa51a510fa8
parentbd67d6f32c813eb3c17a07d305db7004c2dcee0a
Made SocketType and socket the same thing: a subclassable type whose
constructor acts just like socket() before.  All three arguments have
a sensible default now; socket() is equivalent to
socket(AF_INET, SOCK_STREAM).

One minor issue: the socket() function and the SocketType had
different doc strings; socket.__doc__ gave the signature,
SocketType.__doc__ gave the methods.  I've merged these for now, but
maybe the list of methods is no longer necessary since it can easily
be recovered through socket.__dict__.keys().  The problem with keeping
it is that the total doc string is a bit long (34 lines -- it scrolls
of a standard tty screen).

Another general issue with the socket module is that it's a big mess.
There's pages and pages of random platform #ifdefs, and the naming
conventions are totally wrong: it uses Py prefixes and CapWords for
static functions.  That's a cleanup for another day...  (Also I think
the big starting comment that summarizes the API can go -- it's a
repeat of the docstring.)
Modules/socketmodule.c