Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0de6580

Browse files
author
Skip Montanaro
committed
bunch more __all__ lists
also modified check_all function to suppress all warnings since they aren't relevant to what this test is doing (allows quiet checking of regsub, for instance)
1 parent 04f1d37 commit 0de6580

28 files changed

Lines changed: 111 additions & 1 deletion

Lib/pre.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@
8787
import sys
8888
from pcre import *
8989

90-
__all__ = ["match","search","sub","subn","split","findall","escape","compile"]
90+
__all__ = ["match","search","sub","subn","split","findall","escape","compile",
91+
"I","L","M","S","X","IGNORECASE","LOCALE","MULTILINE","DOTALL",
92+
"VERBOSE","error"]
9193

9294
#
9395
# First, the public part of the interface:

Lib/random.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ def create_generators(num, delta, firstseed=None):
7676
from math import log as _log, exp as _exp, pi as _pi, e as _e
7777
from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin
7878

79+
__all__ = ["Random","seed","random","uniform","randint","choice",
80+
"randrange","shuffle","normalvariate","lognormvariate",
81+
"cunifvariate","expovariate","vonmisesvariate","gammavariate",
82+
"stdgamma","gauss","betavariate","paretovariate","weibullvariate",
83+
"getstate","setstate","jumpahead","whseed"]
84+
7985
def _verify(name, expected):
8086
computed = eval(name)
8187
if abs(computed - expected) > 1e-7:

Lib/re.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
if engine == "sre":
2727
# New unicode-aware engine
2828
from sre import *
29+
from sre import __all__
2930
else:
3031
# Old 1.5.2 engine. This one supports 8-bit strings only,
3132
# and will be removed in 2.0 final.
3233
from pre import *
34+
from pre import __all__

Lib/reconvert.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
import regex
6464
from regex_syntax import * # RE_*
6565

66+
__all__ = ["convert","quote"]
67+
6668
# Default translation table
6769
mastertable = {
6870
r'\<': r'\b',

Lib/regex_syntax.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,9 @@
5151
RE_SYNTAX_EMACS = 0
5252

5353
# (Python's obsolete "regexp" module used a syntax similar to awk.)
54+
55+
__all__ = locals().keys()
56+
for _i in range(len(__all__)-1,-1,-1):
57+
if __all__[_i][0] == "_":
58+
del __all__[_i]
59+
del _i

Lib/regsub.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import regex
2121

22+
__all__ = ["sub","gsub","split","splitx","capwords"]
2223

2324
# Replace first occurrence of pattern pat in string str by replacement
2425
# repl. If the pattern isn't found, the string is returned unchanged.

Lib/repr.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Redo the `...` (representation) but with limits on most sizes."""
22

3+
__all__ = ["Repr","repr"]
4+
35
class Repr:
46
def __init__(self):
57
self.maxlevel = 6

Lib/rexec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import os
2424
import ihooks
2525

26+
__all__ = ["RExec"]
2627

2728
class FileBase:
2829

Lib/rfc822.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959

6060
import time
6161

62+
__all__ = ["Message","AddressList","parsedate","parsedate_tz","mktime_tz"]
6263

6364
_blanklines = ('\r\n', '\n') # Optimization for islast()
6465

Lib/rlcompleter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
import __builtin__
4444
import __main__
4545

46+
__all__ = ["Completer"]
47+
4648
class Completer:
4749

4850
def complete(self, text, state):

0 commit comments

Comments
 (0)