Skip to content

Commit 40fc160

Browse files
author
Skip Montanaro
committed
final round of __all__ lists (I hope) - skipped urllib2 because Moshe may be
giving it a slight facelift
1 parent 58eadba commit 40fc160

17 files changed

+59
-1
lines changed

Lib/tabnanny.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import getopt
1717
import tokenize
1818

19+
__all__ = ["check"]
20+
1921
verbose = 0
2022
filename_only = 0
2123

Lib/telnetlib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
import socket
4242
import select
4343

44+
__all__ = ["Telnet"]
45+
4446
# Tunable parameters
4547
DEBUGLEVEL = 0
4648

Lib/tempfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
import os
88

9+
__all__ = ["mktemp", "TemporaryFile", "tempdir", "gettempprefix"]
10+
911
# Parameters that the caller may set to override the defaults
1012
tempdir = None
1113
template = None

Lib/test/test___all__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,19 @@ def check_all(modname):
135135
check_all("socket")
136136
check_all("sre")
137137
check_all("stat_cache")
138+
check_all("tabnanny")
139+
check_all("telnetlib")
140+
check_all("tempfile")
141+
check_all("toaiff")
142+
check_all("tokenize")
143+
check_all("traceback")
144+
check_all("tty")
145+
check_all("urllib")
146+
check_all("urlparse")
147+
check_all("uu")
148+
check_all("warnings")
149+
check_all("wave")
150+
check_all("weakref")
151+
check_all("webbrowser")
152+
check_all("xdrlib")
153+
check_all("zipfile")

Lib/toaiff.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import pipes
1414
import sndhdr
1515

16+
__all__ = ["error", "toaiff"]
17+
1618
table = {}
1719

1820
t = pipes.Template()

Lib/tokenize.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@
1414
import string, re
1515
from token import *
1616

17+
import token
18+
__all__ = [x for x in dir(token) if x[0] != '_'] + ["COMMENT", "tokenize", "NL"]
19+
del token
20+
1721
COMMENT = N_TOKENS
1822
tok_name[COMMENT] = 'COMMENT'
1923
NL = N_TOKENS + 1
2024
tok_name[NL] = 'NL'
21-
25+
N_TOKENS += 2
2226

2327
# Changes from 1.3:
2428
# Ignore now accepts \f as whitespace. Operator now includes '**'.

Lib/traceback.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
import sys
55
import types
66

7+
__all__ = ['extract_stack', 'extract_tb', 'format_exception',
8+
'format_exception_only', 'format_list', 'format_stack',
9+
'format_tb', 'print_exc', 'print_exception', 'print_last',
10+
'print_stack', 'print_tb', 'tb_lineno']
11+
712
def _print(file, str='', terminator='\n'):
813
file.write(str+terminator)
914

Lib/tty.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from termios import *
66

7+
__all__ = ["setraw", "setcbreak"]
8+
79
# Indexes for termios list.
810
IFLAG = 0
911
OFLAG = 1

Lib/urllib.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
import sys
2929
import types
3030

31+
__all__ = ["urlopen", "URLopener", "FancyURLopener", "urlretrieve",
32+
"urlcleanup", "quote", "quote_plus", "unquote", "unquote_plus",
33+
"urlencode"]
34+
3135
__version__ = '1.15' # XXX This version is not always updated :-(
3236

3337
MAXFTPCACHE = 10 # Trim the ftp cache beyond this size

Lib/urlparse.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
UC Irvine, June 1995.
55
"""
66

7+
__all__ = ["urlparse", "urlunparse", "urljoin"]
8+
79
# A classification of schemes ('' means apply by default)
810
uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'wais', 'file',
911
'https', 'shttp',

Lib/uu.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import os
3535
import sys
3636

37+
__all__ = ["Error", "encode", "decode"]
38+
3739
class Error(Exception):
3840
pass
3941

Lib/warnings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import sys, re, types
44

5+
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
6+
"resetwarnings"]
7+
58
defaultaction = "default"
69
filters = []
710
onceregistry = {}

Lib/wave.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373

7474
import __builtin__
7575

76+
__all__ = ["open", "openfp", "Error"]
77+
7678
class Error(Exception):
7779
pass
7880

Lib/weakref.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919

2020
ProxyTypes = (ProxyType, CallableProxyType)
2121

22+
__all__ = ["ref", "mapping", "proxy", "getweakrefcount", "getweakrefs",
23+
"WeakKeyDictionary", "ReferenceType", "ProxyType",
24+
"CallableProxyType", "ProxyTypes", "WeakValueDictionary"]
2225

2326
def mapping(dict=None,weakkeys=0):
2427
if weakkeys:

Lib/webbrowser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import os
44
import sys
55

6+
__all__ = ["Error", "open", "get", "register"]
7+
68
class Error(Exception):
79
pass
810

Lib/xdrlib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
import struct
88

9+
__all__ = ["Error", "Packer", "Unpacker", "ConversionError"]
10+
911
# exceptions
1012
class Error:
1113
"""Exception class for this module. Use:

Lib/zipfile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
except:
1111
zlib = None
1212

13+
__all__ = ["BadZipfile", "error", "ZIP_STORED", "ZIP_DEFLATED", "is_zipfile",
14+
"ZipInfo", "ZipFile", "PyZipFile"]
15+
1316
class BadZipfile(Exception):
1417
pass
1518
error = BadZipfile # The exception raised by this module

0 commit comments

Comments
 (0)