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

Skip to content

Commit 1f2ba4b

Browse files
committed
Rename the repr module to reprlib.
Merged revisions 63357 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r63357 | alexandre.vassalotti | 2008-05-16 02:58:49 -0400 (Fri, 16 May 2008) | 2 lines Changed references to the reprlib module to use its new name. ........
1 parent cdc1133 commit 1f2ba4b

13 files changed

Lines changed: 35 additions & 31 deletions

File tree

Demo/pdist/cmptree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Compare local and remote dictionaries and transfer differing files -- like rdist."""
22

33
import sys
4-
from repr import repr
4+
from reprlib import repr
55
import FSProxy
66
import time
77
import os

Demo/pdist/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import socket
55
import pickle
66
from fnmatch import fnmatch
7-
from repr import repr
7+
from reprlib import repr
88

99

1010
# Default verbosity (0 = silent, 1 = print connections, 2 = print requests too)
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

2-
:mod:`repr` --- Alternate :func:`repr` implementation
2+
:mod:`reprlib` --- Alternate :func:`repr` implementation
33
=====================================================
44

5-
.. module:: repr
5+
.. module:: reprlib
66
:synopsis: Alternate repr() implementation with size limits.
77
.. sectionauthor:: Fred L. Drake, Jr. <[email protected]>
88

99

10-
The :mod:`repr` module provides a means for producing object representations
10+
The :mod:`reprlib` module provides a means for producing object representations
1111
with limits on the size of the resulting strings. This is used in the Python
1212
debugger and may be useful in other contexts as well.
1313

@@ -62,10 +62,13 @@ which format specific object types.
6262
default is ``4`` for :attr:`maxdict`, ``5`` for :attr:`maxarray`, and ``6`` for
6363
the others.
6464

65+
.. versionadded:: 2.4
66+
:attr:`maxset`, :attr:`maxfrozenset`, and :attr:`set`.
67+
6568

6669
.. attribute:: Repr.maxlong
6770

68-
Maximum number of characters in the representation for an integer. Digits
71+
Maximum number of characters in the representation for a long integer. Digits
6972
are dropped from the middle. The default is ``40``.
7073

7174

@@ -129,5 +132,5 @@ for file objects could be added::
129132
return `obj`
130133

131134
aRepr = MyRepr()
132-
print(aRepr.repr(sys.stdin)) # prints '<stdin>'
135+
print aRepr.repr(sys.stdin) # prints '<stdin>'
133136

Doc/tutorial/stdlib2.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ programming needs. These modules rarely occur in small scripts.
1313
Output Formatting
1414
=================
1515

16-
The :mod:`repr` module provides a version of :func:`repr` customized for
16+
The :mod:`reprlib` module provides a version of :func:`repr` customized for
1717
abbreviated displays of large or deeply nested containers::
1818

19-
>>> import repr
20-
>>> repr.repr(set('supercalifragilisticexpialidocious'))
19+
>>> import reprlib
20+
>>> reprlib.repr(set('supercalifragilisticexpialidocious'))
2121
"set(['a', 'c', 'd', 'e', 'f', 'g', ...])"
2222

2323
The :mod:`pprint` module offers more sophisticated control over printing both

Lib/bdb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def get_stack(self, f, t):
324324
#
325325

326326
def format_stack_entry(self, frame_lineno, lprefix=': '):
327-
import linecache, repr
327+
import linecache, reprlib
328328
frame, lineno = frame_lineno
329329
filename = self.canonic(frame.f_code.co_filename)
330330
s = '%s(%r)' % (filename, lineno)
@@ -337,13 +337,13 @@ def format_stack_entry(self, frame_lineno, lprefix=': '):
337337
else:
338338
args = None
339339
if args:
340-
s = s + repr.repr(args)
340+
s = s + reprlib.repr(args)
341341
else:
342342
s = s + '()'
343343
if '__return__' in frame.f_locals:
344344
rv = frame.f_locals['__return__']
345345
s = s + '->'
346-
s = s + repr.repr(rv)
346+
s = s + reprlib.repr(rv)
347347
line = linecache.getline(filename, lineno)
348348
if line: s = s + lprefix + line.strip()
349349
return s

Lib/copy.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,16 @@ def __deepcopy__(self, memo=None):
354354
print(l2)
355355
l.append({l[1]: l, 'xyz': l[2]})
356356
l3 = copy(l)
357-
import repr
358-
print(map(repr.repr, l))
359-
print(map(repr.repr, l1))
360-
print(map(repr.repr, l2))
361-
print(map(repr.repr, l3))
357+
import reprlib
358+
print(map(reprlib.repr, l))
359+
print(map(reprlib.repr, l1))
360+
print(map(reprlib.repr, l2))
361+
print(map(reprlib.repr, l3))
362362
l3 = deepcopy(l)
363-
import repr
364-
print(map(repr.repr, l))
365-
print(map(repr.repr, l1))
366-
print(map(repr.repr, l2))
367-
print(map(repr.repr, l3))
363+
print(map(reprlib.repr, l))
364+
print(map(reprlib.repr, l1))
365+
print(map(reprlib.repr, l2))
366+
print(map(reprlib.repr, l3))
368367

369368
if __name__ == '__main__':
370369
_test()

Lib/idlelib/Debugger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ def __init__(self, master, title, dict=None):
412412
height = 20*len(dict) # XXX 20 == observed height of Entry widget
413413
self.master = master
414414
self.title = title
415-
import repr
416-
self.repr = repr.Repr()
415+
import reprlib
416+
self.repr = reprlib.Repr()
417417
self.repr.maxstring = 60
418418
self.repr.maxother = 60
419419
self.frame = frame = Frame(master)

Lib/idlelib/ObjectBrowser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas
1313

14-
from repr import Repr
14+
from reprlib import Repr
1515

1616
myrepr = Repr()
1717
myrepr.maxstring = 100

Lib/pdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import linecache
99
import cmd
1010
import bdb
11-
from repr import Repr
11+
from reprlib import Repr
1212
import os
1313
import re
1414
import pprint

Lib/pydoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class or function within a module or module in a package. If the
5353
# path will be displayed.
5454

5555
import sys, imp, os, re, inspect, builtins, pkgutil
56-
from repr import Repr
56+
from reprlib import Repr
5757
try:
5858
from collections import deque
5959
except ImportError:

0 commit comments

Comments
 (0)