summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-05-06 14:28:19 (GMT)
committerGuido van Rossum <guido@python.org>1994-05-06 14:28:19 (GMT)
commit2922c6dabbd9f8e49975ff3d972644c7212882e9 (patch)
tree3ea84b9ee77599005eee665078cb486deb7209e6 /Lib/httplib.py
parente4c6131baab4d09d31d280fa7dbca76cbe319dbb (diff)
downloadcpython-2922c6dabbd9f8e49975ff3d972644c7212882e9.zip
cpython-2922c6dabbd9f8e49975ff3d972644c7212882e9.tar.gz
cpython-2922c6dabbd9f8e49975ff3d972644c7212882e9.tar.bz2
Changes to use default argument values where possible
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index d494e21..362b38d 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -43,20 +43,16 @@ replyprog = regex.compile(replypat)
class HTTP:
- def __init__(self, *args):
+ def __init__(self, host = '', port = 0):
self.debuglevel = 0
- if args: apply(self.connect, args)
+ if host: self.connect(host, port)
def set_debuglevel(self, debuglevel):
self.debuglevel = debuglevel
- def connect(self, host, *args):
- if args:
- if args[1:]: raise TypeError, 'too many args'
- port = args[0]
- else:
+ def connect(self, host, port = 0):
+ if not port:
i = string.find(host, ':')
- port = None
if i >= 0:
host, port = host[:i], host[i+1:]
try: port = string.atoi(port)