summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2000-08-22 03:00:52 (GMT)
committerSkip Montanaro <skip@pobox.com>2000-08-22 03:00:52 (GMT)
commit79f1c1778d328b42e67e1480d3a2349e9408d634 (patch)
tree754cffa19a2e47586cae24db2a48c27c1036cf87
parent46dfa5f4ed16c64edc845fffd4a5e2517415a2d6 (diff)
downloadcpython-79f1c1778d328b42e67e1480d3a2349e9408d634.zip
cpython-79f1c1778d328b42e67e1480d3a2349e9408d634.tar.gz
cpython-79f1c1778d328b42e67e1480d3a2349e9408d634.tar.bz2
* added doc strings to urlopen and unquote_plus
* fixed type in doc string for quote
-rw-r--r--Lib/urllib.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index a5be416..d474cfb 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -53,6 +53,7 @@ else:
# Shortcut for basic usage
_urlopener = None
def urlopen(url, data=None):
+ """urlopen(url [, data]) -> open file-like object"""
global _urlopener
if not _urlopener:
_urlopener = FancyURLopener()
@@ -1003,6 +1004,7 @@ def unquote(s):
return string.join(res, "")
def unquote_plus(s):
+ """unquote('%7e/abc+def') -> '~/abc def'"""
if '+' in s:
# replace '+' with ' '
s = string.join(string.split(s, '+'), ' ')
@@ -1010,7 +1012,7 @@ def unquote_plus(s):
always_safe = string.letters + string.digits + '_,.-'
def quote(s, safe = '/'):
- """quote('abc def') -> 'abc%20def')."""
+ """quote('abc def') -> 'abc%20def'."""
# XXX Can speed this up an order of magnitude
safe = always_safe + safe
res = list(s)