##// END OF EJS Templates
Remove python 2 references from docstrings, where appropriate.
Terry Davis -
Show More
@@ -198,8 +198,7 b' def is_simple_callable(obj):'
198
198
199 @undoc
199 @undoc
200 def getargspec(obj):
200 def getargspec(obj):
201 """Wrapper around :func:`inspect.getfullargspec` on Python 3, and
201 """Wrapper around :func:`inspect.getfullargspec`
202 :func:inspect.getargspec` on Python 2.
203
202
204 In addition to functions and methods, this can also handle objects with a
203 In addition to functions and methods, this can also handle objects with a
205 ``__call__`` attribute.
204 ``__call__`` attribute.
@@ -7,13 +7,7 b' passed. The :func:`reload` function in this module also reloads everything'
7 imported from that module, which is useful when you're changing files deep
7 imported from that module, which is useful when you're changing files deep
8 inside a package.
8 inside a package.
9
9
10 To use this as your default reload function, type this for Python 2::
10 To use this as your default reload function, type this::
11
12 import __builtin__
13 from IPython.lib import deepreload
14 __builtin__.reload = deepreload.reload
15
16 Or this for Python 3::
17
11
18 import builtins
12 import builtins
19 from IPython.lib import deepreload
13 from IPython.lib import deepreload
@@ -129,7 +129,7 b' class IPythonPartialTracebackLexer(RegexLexer):'
129 """
129 """
130 Partial lexer for IPython tracebacks.
130 Partial lexer for IPython tracebacks.
131
131
132 Handles all the non-python output. This works for both Python 2.x and 3.x.
132 Handles all the non-python output.
133
133
134 """
134 """
135 name = 'IPython Partial Traceback'
135 name = 'IPython Partial Traceback'
@@ -263,18 +263,7 b' class PrettyPrinter(_PrettyPrinterBase):'
263
263
264 def begin_group(self, indent=0, open=''):
264 def begin_group(self, indent=0, open=''):
265 """
265 """
266 Begin a group. If you want support for python < 2.5 which doesn't has
266 Begin a group.
267 the with statement this is the preferred way:
268
269 p.begin_group(1, '{')
270 ...
271 p.end_group(1, '}')
272
273 The python 2.5 expression would be this:
274
275 with p.group(1, '{', '}'):
276 ...
277
278 The first parameter specifies the indentation for the next line (usually
267 The first parameter specifies the indentation for the next line (usually
279 the width of the opening text), the second the opening text. All
268 the width of the opening text), the second the opening text. All
280 parameters are optional.
269 parameters are optional.
@@ -44,7 +44,7 b' def getdefaultencoding(prefer_stream=True):'
44 Then fall back on locale.getpreferredencoding(),
44 Then fall back on locale.getpreferredencoding(),
45 which should be a sensible platform default (that respects LANG environment),
45 which should be a sensible platform default (that respects LANG environment),
46 and finally to sys.getdefaultencoding() which is the most conservative option,
46 and finally to sys.getdefaultencoding() which is the most conservative option,
47 and usually ASCII on Python 2 or UTF8 on Python 3.
47 and usually UTF8 as of Python 3.
48 """
48 """
49 enc = None
49 enc = None
50 if prefer_stream:
50 if prefer_stream:
@@ -66,8 +66,7 b' def read_py_file(filename, skip_encoding_cookie=True):'
66 The path to the file to read.
66 The path to the file to read.
67 skip_encoding_cookie : bool
67 skip_encoding_cookie : bool
68 If True (the default), and the encoding declaration is found in the first
68 If True (the default), and the encoding declaration is found in the first
69 two lines, that line will be excluded from the output - compiling a
69 two lines, that line will be excluded from the output.
70 unicode string with an encoding declaration is a SyntaxError in Python 2.
71
70
72 Returns
71 Returns
73 -------
72 -------
@@ -91,8 +90,7 b" def read_py_url(url, errors='replace', skip_encoding_cookie=True):"
91 bytes.decode(), but here 'replace' is the default.
90 bytes.decode(), but here 'replace' is the default.
92 skip_encoding_cookie : bool
91 skip_encoding_cookie : bool
93 If True (the default), and the encoding declaration is found in the first
92 If True (the default), and the encoding declaration is found in the first
94 two lines, that line will be excluded from the output - compiling a
93 two lines, that line will be excluded from the output.
95 unicode string with an encoding declaration is a SyntaxError in Python 2.
96
94
97 Returns
95 Returns
98 -------
96 -------
General Comments 0
You need to be logged in to leave comments. Login now