Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(17)

Side by Side Diff: Doc/library/reprlib.rst

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/pyclbr.rst ('k') | Doc/library/shlex.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`reprlib` --- Alternate :func:`repr` implementation 1 :mod:`reprlib` --- Alternate :func:`repr` implementation
2 ======================================================== 2 ========================================================
3 3
4 .. module:: reprlib 4 .. module:: reprlib
5 :synopsis: Alternate repr() implementation with size limits. 5 :synopsis: Alternate repr() implementation with size limits.
6 .. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org> 6 .. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
7 7
8 **Source code:** :source:`Lib/reprlib.py` 8 **Source code:** :source:`Lib/reprlib.py`
9 9
10 -------------- 10 --------------
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 <'a'|'b'|'c'|...|'x'> 59 <'a'|'b'|'c'|...|'x'>
60 60
61 .. versionadded:: 3.2 61 .. versionadded:: 3.2
62 62
63 63
64 .. _repr-objects: 64 .. _repr-objects:
65 65
66 Repr Objects 66 Repr Objects
67 ------------ 67 ------------
68 68
69 :class:`Repr` instances provide several attributes which can be used to provide 69 :class:`Repr` instances provide several members which can be used to provide
70 size limits for the representations of different object types, and methods 70 size limits for the representations of different object types, and methods
71 which format specific object types. 71 which format specific object types.
72 72
73 73
74 .. attribute:: Repr.maxlevel 74 .. attribute:: Repr.maxlevel
75 75
76 Depth limit on the creation of recursive representations. The default is ``6 ``. 76 Depth limit on the creation of recursive representations. The default is ``6 ``.
77 77
78 78
79 .. attribute:: Repr.maxdict 79 .. attribute:: Repr.maxdict
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 class MyRepr(reprlib.Repr): 150 class MyRepr(reprlib.Repr):
151 def repr_file(self, obj, level): 151 def repr_file(self, obj, level):
152 if obj.name in ['<stdin>', '<stdout>', '<stderr>']: 152 if obj.name in ['<stdin>', '<stdout>', '<stderr>']:
153 return obj.name 153 return obj.name
154 else: 154 else:
155 return repr(obj) 155 return repr(obj)
156 156
157 aRepr = MyRepr() 157 aRepr = MyRepr()
158 print(aRepr.repr(sys.stdin)) # prints '<stdin>' 158 print(aRepr.repr(sys.stdin)) # prints '<stdin>'
159 159
OLDNEW
« no previous file with comments | « Doc/library/pyclbr.rst ('k') | Doc/library/shlex.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+